LoginScreenViewModel

ViewModel for the LoginScreen

Constructors

Link copied to clipboard
constructor()

Creates a ViewModel for the LoginScreen

Properties

Link copied to clipboard

StateFlow to observe if the user is created

Link copied to clipboard
val errorMessage: StateFlow<String?>

StateFlow to observe if there is an error

Link copied to clipboard
val isVerificationSent: StateFlow<Boolean>

StateFlow to observe if the verification email is sent

Link copied to clipboard

LiveData to observe if the user is being created

Functions

Link copied to clipboard
Link copied to clipboard
fun createUserWithEmailAndPassword(firstName: String, lastName: String, email: String, password: String, home: () -> Unit)

Create a user with email and password within Firebase Authentication and Database

Link copied to clipboard
fun resetErrorMessage(focusState: FocusState)

Reset error message as the focus on the user form changes

Link copied to clipboard

Reset the ViewModel

Link copied to clipboard
fun signInWithEmailAndPassword(email: String, password: String, home: () -> Unit): Job

Sign in with email and password