mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-26 01:10:39 +00:00
Pass availableFilms
to FilmsProvider
This commit is contained in:
parent
12f222e334
commit
2e929d3630
1 changed files with 6 additions and 1 deletions
|
@ -5,10 +5,12 @@ import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
class FilmsProvider extends StatefulWidget {
|
class FilmsProvider extends StatefulWidget {
|
||||||
final IAPStorageService storageService;
|
final IAPStorageService storageService;
|
||||||
|
final List<Film>? availableFilms;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
const FilmsProvider({
|
const FilmsProvider({
|
||||||
required this.storageService,
|
required this.storageService,
|
||||||
|
this.availableFilms,
|
||||||
required this.child,
|
required this.child,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
@ -36,7 +38,10 @@ class FilmsProviderState extends State<FilmsProvider> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Films(
|
return Films(
|
||||||
values: films,
|
values: [
|
||||||
|
const Film.other(),
|
||||||
|
...widget.availableFilms ?? films,
|
||||||
|
],
|
||||||
filmsInUse: [
|
filmsInUse: [
|
||||||
const Film.other(),
|
const Film.other(),
|
||||||
if (IAPProducts.isPurchased(context, IAPProductType.paidFeatures)) ..._filmsInUse,
|
if (IAPProducts.isPurchased(context, IAPProductType.paidFeatures)) ..._filmsInUse,
|
||||||
|
|
Loading…
Reference in a new issue