UserModel class

Constructors

UserModel({String? id, String? email, String? password, String? token, Map<String, dynamic>? data, List<String>? roles, DateTime? created, DateTime? modified})
Constructs a UserModel instance for login or authentication tracking.
UserModel.fromJson(Map<String, dynamic> json)
Creates a UserModel from a JSON response, usually from the auth API.
factory

Properties

created DateTime?
Timestamp of when the user was created.
final
data Map<String, dynamic>?
User's data fields (custom form fields from user resource form).
final
email String?
User's email address used for login.
final
hashCode int
The hash code for this object.
no setterinherited
id String?
Unique ID of the user (if available).
final
modified DateTime?
Timestamp of when the user was last modified.
final
password String?
User's password used for login/registration. Note: This field is typically null when fetching user data.
final
roles List<String>?
List of role IDs assigned to this user.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String?
JWT token issued upon successful authentication.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the full user model to JSON.
toLoginJson() Map<String, dynamic>
Converts the user credentials into a JSON-compatible map for login.
toRegisterJson() Map<String, dynamic>
Converts the user data into JSON for registration.
toString() String
A string representation of this object.
override
toUpdateJson() Map<String, dynamic>
Converts user data to JSON for update operations.

Operators

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