getStorefront property

QueryGetStorefrontHandler get getStorefront

Get the current storefront country code (unified method)

Implementation

gentype.QueryGetStorefrontHandler get getStorefront => () async {
      if (!_platform.isIOS && !_platform.isAndroid) {
        return '';
      }

      try {
        final String? storefront = await channel.invokeMethod<String>(
          'getStorefront',
        );
        return storefront ?? '';
      } catch (error) {
        debugPrint(
          '[getStorefront] Failed to get storefront on ${_platform.operatingSystem}: $error',
        );
        throw PurchaseError(
          code: gentype.ErrorCode.ServiceError,
          message: 'Failed to get storefront: ${error.toString()}',
        );
      }
    };