import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'billing_service.dart'; import 'play_billing_service.dart'; /// Provider for the platform [BillingService]. /// Defaults to [PlayBillingService] in production. /// In automated tests, override with [FakeBillingService]. final billingServiceProvider = Provider((ref) { final service = PlayBillingService(); ref.onDispose(() => service.dispose()); return service; }); /// Convenience provider exposing availability of the billing service. final billingAvailabilityProvider = FutureProvider((ref) async { final service = ref.watch(billingServiceProvider); return await service.isAvailable(); });