新增登录

This commit is contained in:
2024-07-30 16:57:25 +08:00
parent f28236b365
commit 2c79195f44
8 changed files with 237 additions and 63 deletions

View File

@@ -64,14 +64,14 @@ sealed class NavigationRoute(
@Composable
fun NavigationController(navController: NavHostController) {
fun NavigationController(navController: NavHostController,startDestination: String = NavigationRoute.Login.route) {
val navigationBarHeight = with(LocalDensity.current) {
WindowInsets.navigationBars.getBottom(this).toDp()
}
NavHost(
navController = navController,
startDestination = NavigationRoute.Index.route,
startDestination = startDestination,
) {
composable(route = NavigationRoute.Index.route) {
CompositionLocalProvider(
@@ -170,7 +170,7 @@ fun NavigationController(navController: NavHostController) {
@OptIn(ExperimentalSharedTransitionApi::class)
@Composable
fun Navigation() {
fun Navigation(startDestination: String = NavigationRoute.Login.route) {
val navController = rememberNavController()
SharedTransitionLayout {
CompositionLocalProvider(
@@ -178,7 +178,7 @@ fun Navigation() {
LocalSharedTransitionScope provides this@SharedTransitionLayout,
) {
Box {
NavigationController(navController = navController)
NavigationController(navController = navController,startDestination = startDestination)
}
}
}