UserModel class
A driver account on the My Fuel Orders platform.
Holds identity, contact, and preference data returned by the
/api/user endpoint. All models are manually serialised — no code
generation is used.
This class is immutable. Use copyWith to create modified instances. Two instances are equal when all fields match (via Equatable).
Use empty as a sentinel and isEmpty / isNotEmpty to test for it.
Constructors
Properties
- createdAt → DateTime?
-
The timestamp at which this account was created, or
nullif not provided by the API.final - email → String
-
The driver's email address.
final
- emailVerifiedAt → DateTime?
-
The timestamp at which the driver's email was verified, or
nullif unverified.final - firstName → String
-
The driver's given name.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
The unique numeric identifier assigned by the backend.
final
- isEmpty → bool
-
Whether this instance represents the absent-user sentinel.
no setter
- isNotEmpty → bool
-
Whether this instance represents a real user.
no setter
- isNotificationsEnabled → bool
-
Whether push notifications are enabled for this driver.
final
- lastName → String
-
The driver's family name.
final
- profileImageUrl → String?
-
The URL of the driver's profile image, or
nullif none has been set.final -
props
→ List<
Object?> -
Fields used for value-based equality and hash code computation.
no setteroverride
- 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 → DateTime?
-
The timestamp of the most recent account update, or
nullif not provided by the API.final
Methods
-
copyWith(
{int? id, String? firstName, String? lastName, String? email, String? profileImageUrl, bool? isNotificationsEnabled, DateTime? emailVerifiedAt, DateTime? createdAt, DateTime? updatedAt}) → UserModel - Creates a copy of this user with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this user to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
tryFromJson(
Map< String, dynamic> json) → UserModel? - Attempts to parse a UserModel from an API response map.