updateUser static method

Future<ParseUserResponse> updateUser(
  1. String id,
  2. String token,
  3. Map<String, dynamic> data
)

updates user with id if token is valid using the provided data

Implementation

static Future<ParseUserResponse> updateUser(
    String id, String token, Map<String, dynamic> data) async {
  // ignore: omit_local_variable_types
  final Map<String, String> tmpHead = {}
    ..addAll(_headers)
    ..['X-Parse-Session-Token'] = token;
  var response = await http.put('$_url/parse/users/$id',
      body: jsonEncode(data), headers: tmpHead);
  _errorHandler(response);
  return ParseUserResponse(response.statusCode == 200,
      DateTime.parse(jsonDecode(response.body)['updatedAt']));
}