Hook navigation up
This commit is contained in:
parent
76f2d243b4
commit
55b3ee8ee5
@ -4,4 +4,6 @@ sealed class Destinations{
|
||||
object Login
|
||||
object Profile
|
||||
object Scan
|
||||
object Admin
|
||||
object Options
|
||||
}
|
@ -7,6 +7,7 @@ import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import com.nto.data.utils.Destinations
|
||||
import com.nto.presentation.screens.loginScreen.LoginScreen
|
||||
import com.nto.presentation.screens.profileScreen.ProfileScreen
|
||||
|
||||
@Composable
|
||||
fun Navigation(navController: NavHostController, modifier: Modifier = Modifier) {
|
||||
@ -19,10 +20,16 @@ fun Navigation(navController: NavHostController, modifier: Modifier = Modifier)
|
||||
LoginScreen(navController)
|
||||
}
|
||||
composable(Destinations.Profile.toString()){
|
||||
//TODO
|
||||
ProfileScreen(navController)
|
||||
}
|
||||
composable(Destinations.Scan.toString()){
|
||||
//TODO
|
||||
}
|
||||
composable(Destinations.Admin.toString()){
|
||||
//TODO
|
||||
}
|
||||
composable(Destinations.Options.toString()){
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.nto.presentation.screens.profileScreen
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.navigation.NavController
|
||||
import com.nto.data.utils.Destinations
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
@ -15,19 +16,19 @@ class ProfileViewModel @Inject constructor() : ViewModel() {
|
||||
val state: StateFlow<ProfileState>
|
||||
get() = _state.asStateFlow()
|
||||
|
||||
fun admin(navController: NavController){
|
||||
fun admin(navController: NavController) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
fun option(navController: NavController){
|
||||
//TODO
|
||||
}
|
||||
|
||||
fun logout(navController: NavController){
|
||||
fun logout(navController: NavController) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
fun scan(navController: NavController) {
|
||||
//TODO
|
||||
navController.navigate(Destinations.Scan.toString())
|
||||
}
|
||||
|
||||
fun option(navController: NavController) {
|
||||
navController.navigate(Destinations.Options.toString())
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user