createUser static method
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;
}