CurrentUser class

Represents the currently authenticated user.

Android Reference: com.cometchat.chat.models.CurrentUser

This class extends User and adds additional properties specifically related to authentication, such as authToken, identity, secret, jwt, and fat fields.

The identity and secret fields are extracted from the wsChannel nested object in the authentication response.

Inheritance

Constructors

CurrentUser({required String uid, required String name, String? avatar, String? link, String? role, String? status, String? statusMessage, DateTime? lastActiveAt, List<String>? tags, Map<String, dynamic>? metadata, bool? hasBlockedMe, bool? blockedByMe, DateTime? deactivatedAt, String? authToken, String? identity, String? secret, String? jwt, String? fat})
Constructs a new CurrentUser instance.
CurrentUser.fromMap(Map<String, dynamic> map)
Creates a CurrentUser from a map, restoring auth-specific fields.
factory

Properties

authToken → String?
Authentication token for API requests.
final
avatar ↔ String?
getter/setter pairinherited
blockedByMe ↔ bool?
getter/setter pairinherited
deactivatedAt ↔ DateTime?
Timestamp when user was deactivated. Returns null if user is not deactivated.
getter/setter pairinherited
fat → String?
FAT (Firebase Auth Token) for push notifications.
final
hasBlockedMe ↔ bool?
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setteroverride
identity → String?
WebSocket identity for real-time communication.
final
jwt → String?
JWT token for authentication.
final
lastActiveAt ↔ DateTime?
getter/setter pairinherited
getter/setter pairinherited
metadata ↔ Map<String, dynamic>?
getter/setter pairinherited
name ↔ String
getter/setter pairinherited
role ↔ String?
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secret → String?
WebSocket secret for authentication.
final
status ↔ String?
getter/setter pairinherited
statusMessage ↔ String?
getter/setter pairinherited
tags ↔ List<String>?
getter/setter pairinherited
uid ↔ String
getter/setter pairinherited

Methods

copyWith({String? uid, String? name, String? avatar, String? link, String? role, String? status, String? statusMessage, DateTime? lastActiveAt, List<String>? tags, Map<String, dynamic>? metadata, bool? hasBlockedMe, bool? blockedByMe, DateTime? deactivatedAt, String? authToken, String? identity, String? secret, String? jwt, String? fat}) → CurrentUser
Creates a copy with updated fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Generates a map representing the User.
inherited
toMap() → Map<String, dynamic>
Generates a map including CurrentUser-specific auth fields.
override
toString() → String
Generates a string representation of the User.
override

Operators

operator ==(Object other) → bool
The equality operator.
override