mirror of
https://github.com/koloideal/Casha.git
synced 2026-08-08 17:51:14 +03:00
step
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'paywall_banner.dart';
|
||||
|
||||
class PaywallGuard extends ConsumerWidget {
|
||||
final bool canAccess;
|
||||
final Widget child;
|
||||
final Widget? fallback;
|
||||
|
||||
const PaywallGuard({
|
||||
super.key,
|
||||
required this.canAccess,
|
||||
required this.child,
|
||||
this.fallback,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
if (canAccess) return child;
|
||||
return fallback ?? PaywallBanner();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user