get static method

Future<Map<String, dynamic>?> get(
  1. String url, {
  2. Map<String, dynamic>? params,
})

get请求

Implementation

static Future<Map<String,dynamic>?> get(String url, {Map<String, dynamic>? params}) async {
  try {
    assetDio();
    var result = await _dio!.get(url, queryParameters: params);
    return result.isSuccessful ? (result.data ?? {}) : null;
  } on DioException catch (e) {
    return _convertException(e, url);
  } on SocketException catch (e) {
    return _convertException(e, url, params: params);
  }
}