fetchList<D> method

  1. @protected
Future<List<D>> fetchList<D>(
  1. AgRequest request,
  2. D fromJson(
    1. Map<String, dynamic> json
    )
)
inherited

Sends request and decodes the response as a list — the one-liner every feature-specific "fetch many" method should be.

Implementation

@protected
Future<List<D>> fetchList<D>(
  AgRequest request,
  D Function(Map<String, dynamic> json) fromJson,
) async {
  final response = await send<Object?>(request, decode: (json) => json);
  return decodeListPayload(response.data, fromJson);
}