allProducts static method

Future<List<PLYProduct>> allProducts()

Implementation

static Future<List<PLYProduct>> allProducts() async {
  final List result = await _channel.invokeMethod('allProducts');
  List<PLYProduct> products = new List.empty(growable: true);
  result.forEach((element) {
    final List<PLYPlan?> plans = new List.empty(growable: true);
    element['plans']
        .forEach((k, plan) => {plans.add(transformToPLYPlan(plan))});
    products.add(PLYProduct(
        element['name'], element['vendorId'], plans.whereNotNull().toList()));
  });
  return products;
}