post method Null safety

Future post(
  1. dynamic body,
  2. {int? handleId}
)

Implementation

Future<dynamic> post(body, {int? handleId}) async {
  var suffixUrl = '';
  if (sessionId != null && handleId == null) {
    suffixUrl = suffixUrl + "/$sessionId";
  } else if (sessionId != null && handleId != null) {
    suffixUrl = suffixUrl + "/$sessionId/$handleId";
  }
  try {
    var response = (await http.post(Uri.parse(url! + suffixUrl), body: stringify(body))).body;
    return parse(response);
  } on JsonCyclicError {
    return null;
  } on JsonUnsupportedObjectError {
    return null;
  } catch (e) {
    return null;
  }
}