Disable list tile onTap if IAP is pending

This commit is contained in:
Vadim 2023-11-07 12:03:38 +01:00
parent 068834bfe5
commit 434327a7d0

View file

@ -18,12 +18,14 @@ class BuyProListTile extends StatelessWidget {
return ListTile( return ListTile(
leading: const Icon(Icons.star), leading: const Icon(Icons.star),
title: Text(unlockFeaturesEnabled ? S.of(context).unlockProFeatures : S.of(context).buyLightmeterPro), title: Text(unlockFeaturesEnabled ? S.of(context).unlockProFeatures : S.of(context).buyLightmeterPro),
onTap: () { onTap: !isPending
showBuyProDialog(context); ? () {
ServicesProvider.of(context) showBuyProDialog(context);
.analytics ServicesProvider.of(context)
.logUnlockProFeatures(unlockFeaturesEnabled ? 'Unlock Pro features' : 'Buy Lightmeter Pro'); .analytics
}, .logUnlockProFeatures(unlockFeaturesEnabled ? 'Unlock Pro features' : 'Buy Lightmeter Pro');
}
: null,
trailing: isPending trailing: isPending
? const SizedBox( ? const SizedBox(
height: Dimens.grid24, height: Dimens.grid24,