list method

Future<List<T>> list({
  1. Map<String, dynamic>? params,
  2. bool protected = false,
  3. bool rootList = false,
  4. bool verbose = false,
})

Implementation

Future<List<T>> list({
  Map<String, dynamic>? params,
  bool protected = false,
  bool rootList = false,
  bool verbose = false,
}) async {
  if (rootList) {
    final Response response = await get(
      '',
      params: params,
      protected: protected,
      verbose: verbose,
    );
    final List results = response.data;
    return results.map((e) => parser.fromJson(e)).toList();
  }

  final Pagination<T> pagination =
      await listPaginated(params: params, protected: protected);
  return pagination.results;
}