UserDatabaseRepo class
The UserDatabaseRepo class provides repository methods for user-related
database operations. It interacts with the DatabaseWrapper to perform
CRUD operations and ensure that user data is managed efficiently in the database.
Constructors
- UserDatabaseRepo(DatabaseWrapper _databaseWrapper)
-
Constructor for
UserDatabaseRepo.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createUser(
UsersDBModel userDBModel) → Future< int> - Creates a new user in the database.
-
ensureUserID(
User user) → Future< User> -
Ensures that a
Userobject has a valid ID. -
getUserByID(
int userID) → Future< User?> -
Retrieves a
Userby their ID. -
getUserByName(
String userName) → Future< User?> -
Retrieves a
Userby their username. -
getUsersDBModels(
) → Future< List< UsersDBModel> > - Retrieves all users from the database.
-
isUserPasswordCorrect(
{required String userName, required String hashedPassword}) → Future< bool> - Verifies if the provided username and hashed password match a user in the database.
-
login(
{required String userName, required String hashedPassword}) → Future< User?> - Logs in the user by checking their credentials (username and hashed password).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printAllUsers(
) → Future< void> - Prints all users stored in the database.
-
testPrintAllUserDBModels(
) → Future< void> - Prints all user models stored in the database.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited