User class abstract

A class that represents user.

Annotations
  • @JsonSerializable()
  • @immutable

Constructors

User({int? createdAt, String? firstName, required String id, String? imageUrl, String? lastName, int? lastSeen, Map<String, dynamic>? metadata, Role? role, int? updatedAt})
const
factory
User.fromJson(Map<String, dynamic> json)
Creates user from a map (decoded JSON).
factory

Properties

createdAt int?
Created user timestamp, in ms.
final
firstName String?
First name of the user.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique ID of the user.
final
imageUrl String?
Remote image URL representing user's avatar.
final
lastName String?
Last name of the user.
final
lastSeen int?
Timestamp when user was last visible, in ms.
final
metadata Map<String, dynamic>?
Additional custom metadata or attributes related to the user.
final
props List<Object?>
Equatable props.
no setter
role Role?
User Role.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
updatedAt int?
Updated user timestamp, in ms.
final

Methods

copyWith({int? createdAt, String? firstName, String? id, String? imageUrl, String? lastName, int? lastSeen, Map<String, dynamic>? metadata, Role? role, int? updatedAt}) User
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts user to the map representation, encodable to JSON.
toString() String
A string representation of this object.
inherited

Operators

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