get method Null safety

Future get(
  1. String url,
  2. {Map<String, String>? params,
  3. dynamic headers,
  4. bool pure = true,
  5. bool showDebug = false}
)

if pure == true, it will return data without parse it to ApiResponse

Implementation

Future get(String url, {Map<String, String>? params, dynamic headers, bool pure = true, bool showDebug = false}) async {
  try {
    headers = _preRequest(headers);
    var resp = await _dio.get(url + paramsToString(params), options: Options(headers: headers));

    return resp.data;
  } on DioError catch (e) {
    Fluttertoast.showToast(msg: e.message.toString());
    return null;
  }
}