SettingsViewModel

class SettingsViewModel @Inject constructor(client: AppHttpClient, dataService: AppDataService) : ViewModel

ViewModel for SettingsScreen

Constructors

SettingsViewModel
Link copied to clipboard
@Inject
fun SettingsViewModel(client: AppHttpClient, dataService: AppDataService)

Functions

userUpdate
Link copied to clipboard
fun userUpdate(name: String, blog: String, twitterUsername: String?, company: String, location: String, bio: String)

Update user 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

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

Success 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

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

StateFlow for _loading

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

Listen user model