ExamerLogInViewModel

class ExamerLogInViewModel(    authenticationService: AuthenticationService,     passwordManager: PasswordManager,     dispatcherProvider: DispatcherProvider = StandardDispatchersProvider(io = Dispatchers.Main)) : ViewModel, LogInViewModel

This is class represents a viewModel for a login screen.

Parameters

authenticationService

the authentication service to be used.

dispatcherProvider

the dispatcher provider that is to be used in the viewModel. By default, it uses an instance of StandardDispatchersProvider. The io dispatcher is changed to Dispatchers.Main because, the data layer ensures that all suspend functions are main safe.

Constructors

Link copied to clipboard
fun ExamerLogInViewModel(    authenticationService: AuthenticationService,     passwordManager: PasswordManager,     dispatcherProvider: DispatcherProvider = StandardDispatchersProvider(io = Dispatchers.Main))

Functions

Link copied to clipboard
open override fun authenticate(    emailAddress: String,     password: String,     @MainThread onSuccess: () -> Unit)

Used to authenticate an existing user with the specified emailAddress and password. The onSuccess callback will be called when authentication was successful.

Link copied to clipboard
fun clear()
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
Link copied to clipboard
open fun onCleared()
Link copied to clipboard
open override fun removeErrorMessage()

Used to change the uiState to a non-error state thereby removing any associated error messages from the UI layer.

Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T

Properties

Link copied to clipboard
open override val uiState: State<LoginUiState>

A state property the contains the current LoginUiState.