Billing
The Billing feature handles subscription status display and navigation to the web-based management dashboard.
Domain Models
Architecture
We use Riverpod for state management and the Repository pattern for data access.
Repository & Providers
-
BillingRepository: Fetches data directly from Supabase tables (
user_subscriptions,point_wallets). -
InAppPurchaseRepository: Wraps
in_app_purchasepackage. Handles purchase stream, restoration, and backend verification call. -
BillingProviders: Exposes functionality via
subscriptionProvider,pointWalletProvider, andavailableProductsProvider.
Presentation
SubscriptionSection
Located in lib/features/billing/presentation/widgets/subscription_section.dart.
-
Displays:
-
Current Plan Name
-
Subscription Status (localized)
-
Renewal Date
-
-
Actions:
-
Manage Subscription: Opens the Web Dashboard (
WEB_DASHBOARD_URL) in the external browser.
-
This component is embedded in the PaymentDashboardScreen.