getApi<T> method

Future<T> getApi<T>(
  1. Uri uri,
  2. T mapperFunction(
    1. dynamic value
    ), {
  3. Map<String, String>? headers,
  4. bool sendHeaders = true,
})

Implementation

Future<T> getApi<T>(
  Uri uri,
  T Function(dynamic value) mapperFunction, {
  Map<String, String>? headers,
  bool sendHeaders = true,
}) async {
  headers = getHeaders(headers ?? {});
  var caller = client
      .get(
        uri,
        headers: sendHeaders ? headers : null,
      )
      .timeout(timeout);
  return _callApi(caller, mapperFunction);
}