establishConnection method

Future<void> establishConnection(
  1. BuildContext context
)

Implementation

Future<void> establishConnection(BuildContext context) async {
  final bool isConnected = await inAppPurchase.isAvailable();
  if (isConnected) {
    isAvailable = isConnected;
    products = await getProducts(context);
    inAppPurchase.restorePurchases();
    notifyListeners();
  }
}