fetchCoupons static method

Future<List<NetmeraCouponDetail>> fetchCoupons(
  1. int page,
  2. int max
)

Implementation

static Future<List<NetmeraCouponDetail>> fetchCoupons(int page, int max) async {
  return await _platform.invokeMethod(_FETCH_COUPONS, {"page": page, "max": max}).then((receivedJson) {
    List<NetmeraCouponDetail> couponList = List.empty(growable: true);
    receivedJson.forEach((item) {
      couponList.add(NetmeraCouponDetail.fromJson(item));
    });
    return couponList;
  });
}