AdmApp.kt 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package com.framework.mvvm.ui
  2. import androidx.compose.runtime.Composable
  3. import androidx.compose.runtime.CompositionLocalProvider
  4. import androidx.compose.runtime.compositionLocalOf
  5. import androidx.navigation.NavHostController
  6. import androidx.navigation.compose.NavHost
  7. import androidx.navigation.compose.composable
  8. import androidx.navigation.compose.rememberNavController
  9. import com.framework.mvvm.ui.screen.FlashScreen
  10. import com.framework.mvvm.ui.screen.LoginScreen
  11. import com.framework.mvvm.ui.screen.ProjectScreen
  12. val LocalNavHostController = compositionLocalOf<NavHostController?> { null }
  13. @Composable
  14. fun AdmApp() {
  15. val navController: NavHostController = rememberNavController()
  16. CompositionLocalProvider(LocalNavHostController provides navController) {
  17. NavHost(navController = navController, startDestination = "flash") {
  18. composable("flash") {
  19. FlashScreen()
  20. }
  21. composable("login") {
  22. LoginScreen()
  23. }
  24. composable("project") {
  25. ProjectScreen()
  26. }
  27. }
  28. }
  29. }