Created
August 18, 2023 05:51
-
-
Save chiragthummar/82d15c10333b13ee369637675b7ecb77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun DashboardScreen(navigateTo: (route: String) -> Unit) { | |
Scaffold(topBar = { | |
TopAppBar( | |
title = { Text(text = "Dashboard") }, | |
colors = TopAppBarDefaults.topAppBarColors(containerColor = MaterialTheme.colorScheme.primary) | |
) | |
}) { | |
Box( | |
Modifier | |
.padding(it) | |
.fillMaxSize(), contentAlignment = Alignment.Center | |
) { | |
Text(text = "Dashboard Screen Content") | |
} | |
} | |
} | |
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun LoginScreen(navigateTo: (route: String) -> Unit) { | |
Scaffold(topBar = { | |
TopAppBar( | |
title = { Text(text = "Login") }, | |
colors = TopAppBarDefaults.topAppBarColors(containerColor = MaterialTheme.colorScheme.primary) | |
) | |
}) { | |
Column( | |
Modifier | |
.padding(it) | |
.fillMaxSize(), | |
horizontalAlignment = Alignment.CenterHorizontally, | |
verticalArrangement = Arrangement.Center | |
) { | |
Button(onClick = { | |
navigateTo(Screens.Dashboard.route) | |
}) { | |
Text(text = "Login") | |
} | |
Button(onClick = { | |
navigateTo(Screens.Home.Register.route) | |
}) { | |
Text(text = "Register") | |
} | |
} | |
} | |
} | |
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun RegisterScreen(navigateTo: (route: String) -> Unit) { | |
Scaffold(topBar = { | |
TopAppBar( | |
title = { Text(text = "Register") }, | |
colors = TopAppBarDefaults.topAppBarColors(containerColor = MaterialTheme.colorScheme.primary) | |
) | |
}) { | |
Box( | |
Modifier | |
.padding(it) | |
.fillMaxSize(), contentAlignment = Alignment.Center | |
) { | |
Button(onClick = { | |
navigateTo(Screens.Dashboard.route) | |
}) { | |
Text(text = "Register") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment