get<T> method

Future<HttpResponse<T>> get<T>(
  1. String uri, {
  2. Map<String, dynamic>? queryParameters,
  3. Options? options,
  4. CancelToken? cancelToken,
  5. ProgressCallback? onReceiveProgress,
  6. HttpTransformer? httpTransformer,
  7. bool isShowLoading = true,
})

Implementation

Future<HttpResponse<T>> get<T>(String uri,
    {Map<String, dynamic>? queryParameters,
      dio.Options? options,
      dio.CancelToken? cancelToken,
      dio.ProgressCallback? onReceiveProgress,
      HttpTransformer? httpTransformer,
      bool isShowLoading = true}) async {
  try {
    if(isShowLoading) EasyLoading.show(status: 'loading...');
    var response = await _dio.get(
      uri,
      queryParameters: queryParameters,
      options: options,
      cancelToken: cancelToken,
      onReceiveProgress: onReceiveProgress,
    );
    if(isShowLoading) EasyLoading.dismiss();
    return handleResponse(response, httpTransformer: httpTransformer);
  } on Exception catch (e) {
    if(isShowLoading) EasyLoading.dismiss();
    return handleException(e);
  }
}