User class

Represents a user in the Calljmp system.

The User class contains all the essential information about a user, including their identification, profile details, permissions, and metadata. Users are created and managed through the authentication system and can have various tags assigned for role-based access control.

Example

final user = User(
  id: 123,
  email: 'user@example.com',
  name: 'John Doe',
  avatar: 'https://example.com/avatar.jpg',
  tags: ['role:member', 'team:developers'],
  createdAt: DateTime.now(),
);

Constructors

User({required int id, String? email, String? name, String? avatar, List<String>? tags, required DateTime createdAt})
Creates a new User instance.
User.fromJson(Map<String, dynamic> json)
Creates a User instance from a JSON object.
factory

Properties

avatar String?
URL to the user's avatar image.
final
createdAt DateTime
The timestamp when this user was created.
final
email String?
The user's email address.
final
hashCode int
The hash code for this object.
no setterinherited
id int
The unique identifier for this user.
final
name String?
The user's display name.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tags List<String>?
List of tags assigned to this user.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this User instance to a JSON object.
toString() String
Returns a string representation of this User instance.
override

Operators

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