post method

Future post(
  1. dynamic url,
  2. dynamic data
)

HTTP POST request using a url and data payload

Implementation

Future<dynamic> post(url, data) async {
  try {
    Response response =
        await _dio.post(url, data: {"data": json.encode(data)});
    return response.data;
  } catch (error, stacktrace) {
    _printLog("$error stackTrace: $stacktrace");
    return null;
  }
}