registerUser static method

Future<ParseUser> registerUser(
  1. String username,
  2. String password,
  3. {Map<String, dynamic> data}
)

creates and returns new user with username, password and the optional additional data

  • unique username and email is enforced
  • password is stored savly and will be never exposed

Implementation

static Future<ParseUser> registerUser(String username, String password,
    {Map<String, dynamic> data}) async {
  // ignore: omit_local_variable_types
  Map<String, dynamic> push = data ?? {};
  // ignore: omit_local_variable_types
  final Map<String, String> tmpHead = {}
    ..addAll(_headers)
    ..['X-Parse-Revocable-Session'] = '1';
  push['username'] = username;
  push['password'] = password;
  var response = await http.post('$_url/parse/users',
      headers: tmpHead, body: jsonEncode(push));
  _errorHandler(response);
  return ParseUser._fromResponse(response);
}