Created
October 4, 2023 04:42
-
-
Save Mohammed-Alhams/fbd09f8e558a18f0dd1a01df3ceda76b 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
@SuppressLint("ComposableDestinationInComposeScope") | |
@Composable | |
fun NavGraphBuilder.${NAME}ScreenRoute( | |
navController: NavController, | |
viewModel: ${NAME}ViewModel = hiltViewModel() | |
){ | |
composable( | |
route = ROUTE, | |
// arguments = listOf(navArgument("exampleArg") { NavType.IntType }), | |
) { | |
val state = viewModel.uiState.collectAsStateWithLifecycle() | |
${NAME}Screen(state.value, viewModel, navController) | |
} | |
} | |
internal class ${NAME}Args() { | |
constructor(savedStateHandle: SavedStateHandle) : | |
this(/*checkNotNull(savedStateHandle[conversationIdArg]) as String*/) | |
companion object{ | |
//const val argName = "exampleArg" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment