platformCallHandler method

Future platformCallHandler(
  1. MethodCall call
)

Implementation

Future platformCallHandler(MethodCall call) async {
  switch (call.method) {
    case "isProductPurchased":
      bool status = await call.arguments;
      if (purchaseUpdateHandler != null) {
        purchaseUpdateHandler!("isProductPurchased", status);
      }
      break;
    case "success":
      String status = await call.arguments;
      if (purchaseUpdateHandler != null) {
        purchaseUpdateHandler!("success", status);
      }
      break;
    case "cancelled":
      String status = await call.arguments;
      if (purchaseUpdateHandler != null) {
        purchaseUpdateHandler!("cancelled", status);
      }
      break;
    case "error":
      String status = await call.arguments;
      if (purchaseUpdateHandler != null) {
        purchaseUpdateHandler!("error", status);
      }
      break;
    case "restore":
      bool status = await call.arguments;
      if (purchaseUpdateHandler != null) {
        purchaseUpdateHandler!("restore", status);
      }
      break;
    case "price":
      String price = await call.arguments;
      if (priceUpdateHandler != null) {
        priceUpdateHandler!(price);
      }
      break;
    default:
      if (kDebugMode) {
        print('Unknown method ${call.method} ');
      }
  }
}