ChatUser class abstract

A chat platform user with profile information and role.

Equality is id-based so user collections (Set<ChatUser>, lookup maps) deduplicate by id regardless of churn in the profile fields.

Available extensions
Annotations
  • @Freezed.new(equal: false)

Constructors

ChatUser({required String id, String? displayName, String? avatarUrl, String? bio, String? email, @Default.new(UserRole.user) UserRole role, @Default.new(true) bool active, Map<String, dynamic>? custom, UserConfiguration? configuration})
const
factory

Properties

active bool
no setterinherited
avatarUrl String?
no setterinherited
bio String?
no setterinherited
configuration UserConfiguration?
no setterinherited
copyWith → $ChatUserCopyWith<ChatUser>
Create a copy of ChatUser with the given fields replaced by the non-null parameter values.
no setterinherited
custom Map<String, dynamic>?
no setterinherited
displayName String?
no setterinherited
email String?
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
id String
no setterinherited
role UserRole
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_ChatUser value)) → TResult

Available on ChatUser, provided by the ChatUserPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_ChatUser value)?) → TResult?

Available on ChatUser, provided by the ChatUserPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_ChatUser value)?, {required TResult orElse()}) → TResult

Available on ChatUser, provided by the ChatUserPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String? displayName, String? avatarUrl, String? bio, String? email, UserRole role, bool active, Map<String, dynamic>? custom, UserConfiguration? configuration)?, {required TResult orElse()}) → TResult

Available on ChatUser, provided by the ChatUserPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
when<TResult extends Object?>(TResult $default(String id, String? displayName, String? avatarUrl, String? bio, String? email, UserRole role, bool active, Map<String, dynamic>? custom, UserConfiguration? configuration)) → TResult

Available on ChatUser, provided by the ChatUserPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String? displayName, String? avatarUrl, String? bio, String? email, UserRole role, bool active, Map<String, dynamic>? custom, UserConfiguration? configuration)?) → TResult?

Available on ChatUser, provided by the ChatUserPatterns extension

A variant of when that fallback to returning null

Operators

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