User class

User metadata attached to chat messages.

Constructors

User({required int id, String? username})
Creates a chat user.
const
User.fromJson(Map<String, dynamic>? json)
Creates a User from JSON-like map data.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id int
Numeric user identifier.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
username String?
Optional display name.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this user to JSON-like map data.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parseId(Map<String, dynamic>? json) int
Parses a user id, returning 0 when the payload is missing or invalid.