diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/repository/AuthRepository.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/repository/AuthRepository.kt new file mode 100644 index 0000000..cab157c --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/repository/AuthRepository.kt @@ -0,0 +1,6 @@ +package com.example.what_the_fantasy.repository + +import com.example.what_the_fantasy.data.services.IServices +import okhttp3.Request + +class AuthRepository {} diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/states/InfoUserState.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/states/InfoUserState.kt new file mode 100644 index 0000000..e3fe6f7 --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/states/InfoUserState.kt @@ -0,0 +1,12 @@ +package com.example.what_the_fantasy.ui.states + +import com.example.what_the_fantasy.data.model.SrcLanguage + +data class InfoUserState ( + val imagePath : String ="", + val username :String="", + val email : String="", + val password : String="", + val confirmPassword : String="", + val langue : SrcLanguage = SrcLanguage.vo +) \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/viewModels/InfoUserViewModel.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/viewModels/InfoUserViewModel.kt new file mode 100644 index 0000000..3f5fc1a --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/viewModels/InfoUserViewModel.kt @@ -0,0 +1,20 @@ +package com.example.what_the_fantasy.ui.viewModels + +import androidx.lifecycle.ViewModel +import com.example.what_the_fantasy.data.services.ServicesStub +import com.example.what_the_fantasy.ui.states.InfoUserState +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update + +class InfoUserViewModel : ViewModel(){ + private val services = ServicesStub() // faire repository qui gère les services Stub et API + private val _userInfoState = MutableStateFlow(InfoUserState()) + val InfoUserState : StateFlow = _userInfoState.asStateFlow() + + fun setUsername(username : String){ + _userInfoState.update { it.copy(username=username) } + + } +} \ No newline at end of file