ProfileViewModel

class ProfileViewModel @Inject constructor(client: AppHttpClient, dataService: AppDataService, storage: CrossStorage) : ViewModel

ViewModel for ProfileScreen

Constructors

ProfileViewModel
Link copied to clipboard
@Inject
fun ProfileViewModel(client: AppHttpClient, dataService: AppDataService, storage: CrossStorage)

Functions

clearStorage
Link copied to clipboard
fun clearStorage()
updateProfile
Link copied to clipboard
fun updateProfile()

Query update profile

Properties

_error
Link copied to clipboard
private val _error: MutableStateFlow<String?>

Error response

_loading
Link copied to clipboard
private val _loading: MutableStateFlow<Boolean>

Loading query

client
Link copied to clipboard
private val client: AppHttpClient
dataService
Link copied to clipboard
private val dataService: AppDataService
error
Link copied to clipboard
val error: StateFlow<String?>

StateFlow for _error

loading
Link copied to clipboard
val loading: StateFlow<Boolean>

StateFlow for _loading

storage
Link copied to clipboard
private val storage: CrossStorage
user
Link copied to clipboard
val user: Flow<UserModel?>

Listen user model