SignInViewModel

class SignInViewModel @Inject constructor(authRepository: AuthRepository) : ViewModel

ViewModel for the sign-in screen, managing authentication state and validation.

This ViewModel demonstrates form validation with TextFiledData and uses updateState for synchronous field updates and updateWith for async authentication operations. Field validation uses extension functions from core module (isEmailValid, isPasswordValid).

Parameters

authRepository

Repository providing authentication operations.

See also

Immutable data class representing form state

State wrapper with loading and error handling

Extension function for synchronous state updates

Extension function for async operations

Data class for text field state with validation

Data layer interface for authentication

Constructors

Link copied to clipboard
@Inject
constructor(authRepository: AuthRepository)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun signInWithGoogle(activity: Activity)
Link copied to clipboard
Link copied to clipboard
fun updateEmail(email: String)
Link copied to clipboard
fun updatePassword(password: String)