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});
|
const IAPProductsProvider({required this.child, super.key});
|
||||||
|
|
||||||
static IAPProductsProviderState of(BuildContext context) {
|
static IAPProductsProviderState of(BuildContext context) => IAPProductsProvider.maybeOf(context)!;
|
||||||
return context.findAncestorStateOfType<IAPProductsProviderState>()!;
|
|
||||||
|
static IAPProductsProviderState? maybeOf(BuildContext context) {
|
||||||
|
return context.findAncestorStateOfType<IAPProductsProviderState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -54,8 +56,7 @@ class IAPProducts extends InheritedModel<IAPProductType> {
|
||||||
bool updateShouldNotify(IAPProducts oldWidget) => false;
|
bool updateShouldNotify(IAPProducts oldWidget) => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) =>
|
bool updateShouldNotifyDependent(IAPProducts oldWidget, Set<IAPProductType> dependencies) => false;
|
||||||
false;
|
|
||||||
|
|
||||||
IAPProduct? _findProduct(IAPProductType type) {
|
IAPProduct? _findProduct(IAPProductType type) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue