getPaywallProducts method

Future<List<AdaptyPaywallProduct>> getPaywallProducts({
  1. required AdaptyPaywall paywall,
})

Once you have a AdaptyPaywall, fetch corresponding products array using this method.

Parameters:

  • paywall: an AdaptyPaywall for which you want to get a products.

Returns:

Implementation

Future<List<AdaptyPaywallProduct>> getPaywallProducts({
  required AdaptyPaywall paywall,
}) async {
  final result = (await _invokeMethodHandlingErrors<String>(Method.getPaywallProducts, {
    Argument.paywall: json.encode(paywall.jsonValue),
  })) as String;

  final List paywallsResult = json.decode(result);
  return paywallsResult.map((e) => AdaptyPaywallProductJSONBuilder.fromJsonValue(e)).toList();
}