UserModel class

The UserModel class represents a model for a user.

It extends the UserEntity class.

Available extensions

Constructors

UserModel({required int id, required String name, required String email, String? role, String? image})
Creates a new instance of the UserModel class.
const
UserModel.fromEntity(UserEntity user)
Creates a new instance of the UserModel class from a UserEntity instance.
factory
UserModel.fromJson(Map<String, dynamic> json)
Creates a new instance of the UserModel class from a JSON map.
factory

Properties

email String
The email address of the user.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id int
The unique identifier of the user.
finalinherited
image String?
The image URL of the user (optional).
finalinherited
name String
The name of the user.
finalinherited
props List<Object?>
Returns a list of properties used for value comparison.
no setter
role String?
The role of the user (optional).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool
Specifies whether the object should be stringified.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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