unlockFeatureSettingWidget method

Widget unlockFeatureSettingWidget({
  1. bool value = false,
  2. bool enable = true,
  3. void onChanged(
    1. bool
    )?,
})

Implementation

Widget unlockFeatureSettingWidget({
  bool value = false,
  bool enable = true,
  void Function(bool)? onChanged,
}) {
  final futureProduct = InAppPurchaseUtils.getProduct(productId());

  return FutureBuilder(
    future: futureProduct,
    builder: (context, snapshot) {
      final product = snapshot.data;

      final description = (product != null)
          ? '${tr('remove_ads_description')} (${product.price})'
          : tr('remove_ads_description');

      return MenuItemCheckBoxWidget(
        theme: theme,
        value: value,
        enable: enable,
        icon: Icons.tune,
        text: tr('remove_ads'),
        description: description,
        onChanged: onChanged,
      );
    },
  );
}