User class
Represents a User in the meal tracker application.
Contains information such as the user's ID, username, and optionally the hashed password.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hashedPassword ↔ String?
-
The hashed password of the user, optional.
getter/setter pair
- ID ↔ int
-
The unique IDentifier for the user.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userName → String
-
The username of the user.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String - Converts the User instance into a JSON string.
-
toMap(
) → Map< String, dynamic> - Converts the User instance into a Map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
String jsonString) → User - Constructs a User instance from a JSON string.
-
fromMap(
Map map) → User - Constructs a User instance from a Map.
-
getBooleanFromMapValue(
dynamic value) → bool - Utility function to interpret various representations of boolean values.
-
getDemoUser(
) → User - Returns a demo user with preset credentials for demo login.