added loader for IAPProductStatus.pending

This commit is contained in:
Vadim 2023-09-01 21:29:18 +02:00
parent 62833e79bf
commit c99a172d66

View file

@ -2,6 +2,7 @@ import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart';
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
@ -11,7 +12,8 @@ class EquipmentProfilesListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final paidStatus = IAPProducts.productOf(context, IAPProductType.paidFeatures)?.status;
final paidStatus = IAPProducts.productOf(context, IAPProductType.paidFeatures)?.status ??
IAPProductStatus.pending;
log(paidStatus.toString());
return ListTile(
leading: const Icon(Icons.camera),
@ -29,7 +31,11 @@ class EquipmentProfilesListTile extends StatelessWidget {
},
trailing: switch (paidStatus) {
IAPProductStatus.purchasable => const Icon(Icons.lock),
null => const Icon(Icons.lock),
IAPProductStatus.pending => const SizedBox(
height: Dimens.grid24,
width: Dimens.grid24,
child: CircularProgressIndicator(),
),
_ => null,
},
);