createUser static method

Future<User?> createUser(
  1. User user, {
  2. dynamic onSuccess(
    1. User user
    )?,
  3. dynamic onError(
    1. CometChatException e
    )?,
})

Method returns user after creation in cometchat environment

Ideally, user creation should take place at your backend

uid specified on user creation. Not editable after that.

name Display name of the user.

avatar URL to profile picture of the user.

Implementation

static Future<User?> createUser(User user,
    {Function(User user)? onSuccess,
    Function(CometChatException e)? onError}) async {
  if (!checkAuthSettings(onError)) return null;

  User? resultUser;

  resultUser = await CometChat.createUser(
      user, authenticationSettings!.authKey!,
      onSuccess: onSuccess, onError: onError);
  return resultUser;
}