showUnlockFeatureDialog function

Future<void> showUnlockFeatureDialog(
  1. BuildContext context, {
  2. required AppTheme theme,
  3. required ProductDetails product,
  4. String? message,
  5. Color? barrierColor = Colors.black54,
  6. Color? backgroundColor = Colors.white,
  7. void onPurchasePressed()?,
  8. void onClosePressed()?,
})

Shows an "unlock feature" dialog for in-app purchases.

product contains purchase details. Optional styling and callbacks allow customization.

Implementation

Future<void> showUnlockFeatureDialog(
  BuildContext context, {
  required AppTheme theme,
  required ProductDetails product,
  String? message,
  Color? barrierColor = Colors.black54,
  Color? backgroundColor = Colors.white,
  void Function()? onPurchasePressed,
  void Function()? onClosePressed,
}) {
  return showDialogWithAnimation<void>(
    barrierColor: barrierColor,
    context: context,
    child: UnlockFeatureDialog(
      onClosePressed: onClosePressed,
      onPurchasePressed: onPurchasePressed,
      theme: theme,
    ),
  );
}