Profile Screen View Model

class ProfileScreenViewModel(snackbarHostState: SnackbarHostState)

The ProfileScreenViewModel class is the support class used by the ProfileScreen to execute the requests or the action to customize the profile data of the user

Author

N7ghtm4r3 - Tecknobit

Parameters

snackbarHostState

: the host to launch the snackbar messages

See also

FetcherManagerWrapper
EquinoxViewModel

Constructors

Link copied to clipboard
constructor(snackbarHostState: SnackbarHostState)

Properties

Link copied to clipboard
lateinit var newEmail: MutableState<String>

newEmail -> the value of the new email to set

Link copied to clipboard

newEmailError -> whether the newEmail field is not valid

Link copied to clipboard

newPassword -> the value of the new password to set

Link copied to clipboard

newPasswordError -> whether the newPassword field is not valid

Functions

Link copied to clipboard
fun changeCurrentLocalSession(session: <Error class: unknown class>, onChange: () -> Unit)

Function to change the current activeLocalSession

Link copied to clipboard
fun changeEmail(onSuccess: () -> Unit)

Function to execute the email change

Link copied to clipboard
fun changeLanguage(newLanguage: String, onSuccess: () -> Unit)

Function to execute the language change

Link copied to clipboard
fun changePassword(onSuccess: () -> Unit)

Function to execute the password change

Link copied to clipboard
fun changeProfilePic(imagePath: String?, profilePic: MutableState<String>)

Function to execute the profile pic change

Link copied to clipboard
fun deleteAccount(onDelete: () -> Unit, onFailure: () -> Unit)

Function to execute the account deletion

Link copied to clipboard
fun logout(onLogout: () -> Unit)

Method to perform the logout action and clear the current local sessions stored