update method Null safety

Future<ParseResponse> update()

Implementation

Future<ParseResponse> update() async {
  try {
    final Uri url = getSanitisedUri(_client, '$_path/$objectId');
    final String body = json.encode(toJson(forApiRQ: true));
    _saveChanges();
    final Map<String, String> headers = {
      keyHeaderContentType: keyHeaderContentTypeJson
    };
    final ParseNetworkResponse result = await _client.put(url.toString(),
        data: body, options: ParseNetworkOptions(headers: headers));
    return handleResponse<ParseObject>(
        this, result, ParseApiRQ.save, _debug, parseClassName);
  } on Exception catch (e) {
    return handleException(e, ParseApiRQ.save, _debug, parseClassName);
  }
}