update static method

Future<ParseDocResponse> update(
  1. String collection,
  2. String id,
  3. Map<String, dynamic> data
)

updates the document in collection with id and the provided data throws UnsupportedError if user has no access rights or document ist does not exist

Implementation

static Future<ParseDocResponse> update(
    String collection, String id, Map<String, dynamic> data) async {
  var response = await http.put('$_url/parse/classes/$collection/$id',
      headers: _headers, body: jsonEncode(data));
  final success = response.statusCode == 200;
  _errorHandler(response);
  return ParseDocResponse(
      success,
      DocReference(collection, id),
      success
          ? DateTime.parse(jsonDecode(response.body)['updatedAt'])
          : null);
}