get<T> method
Future<HttpResponse<T> >
get<T>(
- String uri, {
- Map<
String, dynamic> ? queryParameters, - Options? options,
- CancelToken? cancelToken,
- ProgressCallback? onReceiveProgress,
- HttpTransformer? httpTransformer,
- 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);
}
}