getPaywallProducts method
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:
- a result containing the AdaptyPaywallProduct objects array. You can present them in your UI.
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();
}