diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 70e6fa4..ac420da 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -15,7 +15,7 @@ jobs: analyze_and_test: name: Analyze & test runs-on: macos-11 - timeout-minutes: 10 + timeout-minutes: 5 steps: - uses: actions/checkout@v3 with: @@ -47,3 +47,10 @@ jobs: - name: Run tests run: flutter test + + - name: Analyze project source with stub + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + run: | + bash ./.github/scripts/stub_iap.sh + flutter pub get + flutter analyze lib --fatal-infos diff --git a/iap/lib/m3_lightmeter_iap.dart b/iap/lib/m3_lightmeter_iap.dart index 2f5d26b..171fe47 100644 --- a/iap/lib/m3_lightmeter_iap.dart +++ b/iap/lib/m3_lightmeter_iap.dart @@ -8,6 +8,7 @@ import 'package:m3_lightmeter_iap/src/providers/iap_products_provider.dart'; export 'src/data/models/iap_product.dart'; export 'src/providers/equipment_profile_provider.dart'; +export 'src/providers/films_provider.dart'; export 'src/providers/iap_products_provider.dart'; class IAPProviders extends StatelessWidget { diff --git a/iap/lib/src/providers/films_provider.dart b/iap/lib/src/providers/films_provider.dart index 461af39..e75ccd3 100644 --- a/iap/lib/src/providers/films_provider.dart +++ b/iap/lib/src/providers/films_provider.dart @@ -23,6 +23,7 @@ class FilmsProviderState extends State { Widget build(BuildContext context) { return Films( values: const [Film.other()], + filmsInUse: const [Film.other()], selected: const Film.other(), child: widget.child, ); @@ -34,15 +35,28 @@ class FilmsProviderState extends State { } class Films extends SelectableInheritedModel { + final List filmsInUse; + const Films({ super.key, required super.values, + required this.filmsInUse, required super.selected, required super.child, }); + /// [Film.other()] + all the custom fields with actual reciprocity formulas static List of(BuildContext context) { - return InheritedModel.inheritFrom(context, aspect: SelectableAspect.list)!.values; + return InheritedModel.inheritFrom(context)!.values; + } + + /// [Film.other()] + films in use selected by user + static List inUseOf(BuildContext context) { + return InheritedModel.inheritFrom( + context, + aspect: SelectableAspect.list, + )! + .filmsInUse; } static Film selectedOf(BuildContext context) { diff --git a/iap/lib/src/providers/selectable_provider.dart b/iap/lib/src/providers/selectable_provider.dart index c4168d3..c18f998 100644 --- a/iap/lib/src/providers/selectable_provider.dart +++ b/iap/lib/src/providers/selectable_provider.dart @@ -13,22 +13,6 @@ class SelectableInheritedModel extends InheritedModel { final List values; final T selected; - static List of(BuildContext context) { - return InheritedModel.inheritFrom>( - context, - aspect: SelectableAspect.list, - )! - .values; - } - - static T selectedOf(BuildContext context) { - return InheritedModel.inheritFrom( - context, - aspect: SelectableAspect.selected, - )! - .selected; - } - @override bool updateShouldNotify(SelectableInheritedModel oldWidget) => true;