get method

Future get(
  1. String uri, {
  2. Map<String, dynamic>? queryParameters,
  3. Future<Map<String, dynamic>>? headers,
  4. CancelToken? cancelToken,
  5. ProgressCallback? onReceiveProgress,
})

Implementation

Future<dynamic> get(
  String uri, {
  Map<String, dynamic>? queryParameters,
  Future<Map<String, dynamic>>? headers,
  CancelToken? cancelToken,
  ProgressCallback? onReceiveProgress,
}) async {
  try {
    final Response response = await _dio.get(
      uri,
      queryParameters: queryParameters,
      options: Options(
        contentType: Headers.jsonContentType,
        headers: await headers,
      ),
      cancelToken: cancelToken,
      onReceiveProgress: onReceiveProgress,
    );
    return response.data;
  } on DioError catch (e) {
    final exeception = await _apiErrorHandler(e);
    throw exeception;
  } catch (e) {
    rethrow;
  }
}