User class

The class that defines the user model

Implementers
Annotations

Constructors

User({String id, String role, DateTime createdAt, DateTime updatedAt, DateTime lastActive, bool online, Map<String, dynamic> extraData, bool banned})
Constructor used for json serialization
User.fromJson(Map<String, dynamic> json)
Create a new instance from a json
factory
User.init(String id, {bool online, Map<String, dynamic> extraData})
Use this named constructor to create a new user instance

Properties

banned bool
True if user is banned from the chat
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
createdAt DateTime
Date of user creation
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
extraData Map<String, dynamic>
Map of custom user extraData
@JsonKey(includeIfNull: false), final
hashCode int
The hash code for this object. [...]
read-only, override
id String
User id
final
lastActive DateTime
Date of last user connection
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
name String
Shortcut for user name
read-only
online bool
True if user is online
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
role String
User role
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
updatedAt DateTime
Date of last user update
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Serialize to json
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
override

Constants

topLevelFields → const List<String>
Known top level fields. Useful for Serialization methods.
const ['id', 'role', 'created_at', 'updated_at', 'last_active', 'online', 'banned']