From 2e929d363072d0c374c0c3f542f3618f62704e64 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:39:40 +0200 Subject: [PATCH] Pass `availableFilms` to `FilmsProvider` --- lib/providers/films_provider.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/providers/films_provider.dart b/lib/providers/films_provider.dart index 8707d55..aff6d01 100644 --- a/lib/providers/films_provider.dart +++ b/lib/providers/films_provider.dart @@ -5,10 +5,12 @@ import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; class FilmsProvider extends StatefulWidget { final IAPStorageService storageService; + final List? availableFilms; final Widget child; const FilmsProvider({ required this.storageService, + this.availableFilms, required this.child, super.key, }); @@ -36,7 +38,10 @@ class FilmsProviderState extends State { @override Widget build(BuildContext context) { return Films( - values: films, + values: [ + const Film.other(), + ...widget.availableFilms ?? films, + ], filmsInUse: [ const Film.other(), if (IAPProducts.isPurchased(context, IAPProductType.paidFeatures)) ..._filmsInUse,