mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
added maybeOf
getter for iap stub
This commit is contained in:
parent
73ebc671f2
commit
77bbeca92e
1 changed files with 5 additions and 4 deletions
|
@ -6,8 +6,10 @@ class IAPProductsProvider extends StatefulWidget {
|
|||
|
||||
const IAPProductsProvider({required this.child, super.key});
|
||||
|
||||
static IAPProductsProviderState of(BuildContext context) {
|
||||
return context.findAncestorStateOfType<IAPProductsProviderState>()!;
|
||||
static IAPProductsProviderState of(BuildContext context) => IAPProductsProvider.maybeOf(context)!;
|
||||
|
||||
static IAPProductsProviderState? maybeOf(BuildContext context) {
|
||||
return context.findAncestorStateOfType<IAPProductsProviderState>();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -54,8 +56,7 @@ class IAPProducts extends InheritedModel<IAPProductType> {
|
|||
bool updateShouldNotify(IAPProducts oldWidget) => false;
|
||||
|
||||
@override
|
||||
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) =>
|
||||
false;
|
||||
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) => false;
|
||||
|
||||
IAPProduct? _findProduct(IAPProductType type) {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue