User class Null safety

Class that defines a Stream Chat User.

Inheritance
Implementers
Annotations

Constructors

User({required String id, String? role, String? name, String? image, DateTime? createdAt, DateTime? updatedAt, DateTime? lastActive, Map<String, Object?> extraData = const {}, bool online = false, bool banned = false, List<String> teams = const [], String? language})
Creates a new user. [...]
User.fromJson(Map<String, dynamic> json)
Create a new instance from json.
factory

Properties

banned bool
True if user is banned from the chat.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
createdAt DateTime
Date of user creation.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
extraData Map<String, Object?>
Map of custom user extraData.
@JsonKey(includeIfNull: false), final
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
User id.
final
image String?
Shortcut for user image. [...]
@JsonKey(ignore: true), read-only
language String?
The language this user prefers.
@JsonKey(includeIfNull: false), final
lastActive DateTime?
Date of last user connection.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
name String
Shortcut for user name. [...]
@JsonKey(ignore: true), read-only
online bool
True if user is online.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
read-only, override
role String?
User role.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props. [...]
read-only, inherited
teams List<String>
User teams
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
updatedAt DateTime
Date of last user update.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final

Methods

copyWith({String? id, String? role, String? name, String? image, DateTime? createdAt, DateTime? updatedAt, DateTime? lastActive, bool? online, Map<String, Object?>? extraData, bool? banned, List<String>? teams, String? language}) User
Creates a copy of User with specified attributes overridden.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Serialize to json.
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

toIds(List<User>? users) List<String>?
List of users to list of userIds.

Constants

topLevelFields → const List<String>
Known top level fields. [...]
['id', 'role', 'created_at', 'updated_at', 'last_active', 'online', 'banned', 'teams', 'language']