Compare commits

...

9 commits

Author SHA1 Message Date
Vadim
88a726b1e2 typo 2023-09-01 21:44:30 +02:00
Vadim
c99a172d66 added loader for IAPProductStatus.pending 2023-09-01 21:29:18 +02:00
Vadim
62833e79bf Include IAP by default 2023-09-01 17:42:02 +02:00
Vadim
9e16b68ae6 more sophisticated iap icons 2023-09-01 17:03:28 +02:00
Vadim
60e3cc6e40 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into feature/iap 2023-09-01 16:35:20 +02:00
github-actions[bot]
d364de4486 Version bump 2023-08-28 15:55:12 +00:00
Vadim
e1c320b804 Replaced user config with github-actions[bot] 2023-08-28 16:01:04 +02:00
Vadim
a9f8223e4a Added Firebase Analytics 2023-08-28 11:39:20 +02:00
Vadim
aee527dcca
Create FUNDING.yml 2023-08-20 11:14:37 +02:00
7 changed files with 22 additions and 11 deletions

3
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [vodemn]

View file

@ -19,7 +19,7 @@ on:
include-iap:
type: boolean
description: Include IAP package
default: false # TODO(@vodemn) when Google fixes their api
default: true
jobs:
build:
@ -36,7 +36,7 @@ jobs:
- name: Override iap package with stub
if: ${{ !inputs.include-iap }}
run: |
echo "\ndependecies_override:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
- uses: actions/checkout@v3
with:

View file

@ -34,7 +34,7 @@ on:
include-iap:
type: boolean
description: Include IAP package
default: false # TODO(@vodemn) when Google fixes their api
default: true
env:
BUILD_ARGS: --release --flavor prod --dart-define cameraPreviewAspectRatio=240/320 -t lib/main_prod.dart
@ -55,7 +55,7 @@ jobs:
- name: Override iap package with stub
if: ${{ !inputs.include-iap }}
run: |
echo "\ndependecies_override:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
- uses: actions/checkout@v3
with:
@ -164,8 +164,8 @@ jobs:
- name: Commit changes
run: |
git config --global user.name "vodemn"
git config --global user.email "vadim.turko@gmail.com"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "Version bump"

View file

@ -30,7 +30,7 @@ jobs:
- name: Override iap package with stub
if: env.STUB_IAP
run: |
echo "\ndependecies_override:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
- uses: actions/checkout@v3
with:

View file

@ -109,4 +109,5 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.billingclient:billing-ktx:6.0.0"
implementation "com.google.firebase:firebase-analytics:17.4.1"
}

View file

@ -2,6 +2,7 @@ import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart';
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
@ -11,7 +12,8 @@ class EquipmentProfilesListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final paidStatus = IAPProducts.productOf(context, IAPProductType.paidFeatures)?.status;
final paidStatus = IAPProducts.productOf(context, IAPProductType.paidFeatures)?.status ??
IAPProductStatus.pending;
log(paidStatus.toString());
return ListTile(
leading: const Icon(Icons.camera),
@ -22,13 +24,18 @@ class EquipmentProfilesListTile extends StatelessWidget {
MaterialPageRoute(builder: (_) => const EquipmentProfilesScreen()),
);
},
IAPProductStatus.purchasable => () {
IAPProductStatus.pending => null,
_ => () {
IAPProductsProvider.of(context).buy(IAPProductType.paidFeatures);
},
_ => null,
},
trailing: switch (paidStatus) {
IAPProductStatus.purchasable => const Icon(Icons.lock),
IAPProductStatus.pending => const SizedBox(
height: Dimens.grid24,
width: Dimens.grid24,
child: CircularProgressIndicator(),
),
_ => null,
},
);

View file

@ -1,7 +1,7 @@
name: lightmeter
description: Lightmeter app inspired by Material 3 design system.
publish_to: "none"
version: 0.13.1+37
version: 0.13.2+38
environment:
sdk: ">=3.0.0 <4.0.0"