get function

Future<Result> get({
  1. String? baseUrl,
  2. String path = '',
  3. Map<String, dynamic>? queryParameters,
  4. Duration? connectTimeout,
  5. BaseCancelToken? cancelToken,
  6. bool validResult = true,
  7. bool autoLoading = false,
})

发送请求并解析远程服务器返回的result对应的实体类型

baseUrl: 主机地址 path: 请求路径 queryParameters: URL携带请求参数 connectTimeout: 超时时间 validResult: 是否检验返回结果 autoLoading: 展示Loading

Implementation

Future<Result> get(
    {String? baseUrl,
    String path = '',
    Map<String, dynamic>? queryParameters,
    Duration? connectTimeout,
    BaseCancelToken? cancelToken,
    bool validResult = true,
    bool autoLoading = false}) async {
  return request(
      baseUrl: baseUrl,
      path: path,
      queryParameters: queryParameters,
      options: Options(method: 'get'),
      connectTimeout: connectTimeout,
      cancelToken: cancelToken,
      validResult: validResult,
      autoLoading: autoLoading);
}