getCommonList<T> static method

Future<List<NamedAPIResource>?> getCommonList<T>(
  1. int offset,
  2. int limit
)

Implementation

static Future<List<NamedAPIResource>?> getCommonList<T>(
    int offset, int limit) async {
  String url = await getBaseUrl<T>();

  url += "?offset=${offset - 1}&limit=$limit";
  var response = await Http.get(Uri.parse(url));
  Map listMap = json.decode(response.body);
  List<NamedAPIResource>? commonResultList = Common.fromJson(listMap as Map<String, dynamic>).results;

  return commonResultList;
}