put method Null safety

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

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

Implementation

Future put(String url, {Map<String, String>? params, dynamic body, dynamic headers, bool pure = true, bool showDebug = false}) async {
  try {
    headers = _preRequest(headers);
    var resp = await _dio.put(url + paramsToString(params), data: body, options: Options(headers: headers));
    return resp.data;
  } on DioError catch (e) {
    Fluttertoast.showToast(msg: e.message.toString());
    return null;
  }
}