Site icon C1CTech

Android Navigate with arguments in Jetpack Compose

&NewLine;<p>This post is about how to pass arguments&sol;data between composable destinations and add optional arguments using Navigation compose&period;<&sol;p> &NewLine; &NewLine; &NewLine; &NewLine;<p>Let&&num;8217&semi;s understand how to pass data between composable destinations and add optional arguments with the help of examples&period;<&sol;p> &NewLine;<h4><span style&equals;"color&colon; &num;000080&semi;"><strong>Creating New Project<&sol;strong><&sol;span><&sol;h4> &NewLine;<p>1 &period; Create a new project by going to <strong>File &Implies; New Android Project<&sol;strong>&comma; select <strong>Empty Compose Activity<&sol;strong>&comma; provide <strong>app<&sol;strong> name and then finally click on <strong>finish<&sol;strong>&period;<&sol;p> &NewLine;<p>2 &period; Open app-level build&period;gradle file and under the <strong>dependencies<&sol;strong> section add the below library and then <strong>sync<&sol;strong> the project<strong>&colon;<&sol;strong><&sol;p> &NewLine;<p><span style&equals;"color&colon; &num;0000ff&semi;"><strong>build&period;gradle<&sol;strong><&sol;span><&sol;p> &NewLine;<pre>dependencies &lbrace;<br &sol;><span style&equals;"color&colon; &num;008000&semi;"> <strong>&sol;&sol;navigation with compose<&sol;strong><&sol;span><br &sol;> implementation&lpar;"androidx&period;navigation&colon;navigation-compose&colon;2&period;4&period;2"&rpar;<br &sol;>&rcub;<&sol;pre> &NewLine;<p>Get the latest navigation-compose dependency from <span style&equals;"color&colon; &num;0000ff&semi;"><strong><a style&equals;"color&colon; &num;0000ff&semi;" href&equals;"https&colon;&sol;&sol;developer&period;android&period;com&sol;jetpack&sol;compose&sol;navigation&num;setup">here<&sol;a><&sol;strong><&sol;span>&period;<&sol;p> &NewLine;<p>3&period; Passing data from First Screen composable to Second Screen composable&period;<&sol;p> &NewLine;<pre>&commat;Composable<br &sol;>fun FirstScreen&lpar;navController&colon; NavController&rpar; &lbrace;<br &sol;> Button&lpar;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to second screen<&sol;span><&sol;strong><br &sol;><span style&equals;"color&colon; &num;0000ff&semi;"> <strong> navController&period;navigate&lpar;"second&lowbar;screen&sol;Second Screen"&rpar;<&sol;strong><&sol;span><br &sol;> &rcub; <br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to Second Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<p>4&period; Retrieving data passed from First Screen composable in the composable&lpar;&rpar; function of route <strong><span style&equals;"color&colon; &num;0000ff&semi;">second&lowbar;screen<&sol;span><&sol;strong> and pass it as a parameter to Second Screen composable&period;<&sol;p> &NewLine;<pre>&commat;Composable<br &sol;>fun MainScreen&lpar;&rpar; &lbrace;<br &sol;> val navController &equals; rememberNavController&lpar;&rpar;<br &sol;><br &sol;> NavHost&lpar;<br &sol;> navController &equals; navController&comma;<br &sol;> startDestination &equals; "first&lowbar;screen"<br &sol;> &rpar; &lbrace;<br &sol;> composable&lpar;"first&lowbar;screen"&rpar; &lbrace;<br &sol;> FirstScreen&lpar;navController &equals; navController&rpar;<br &sol;> &rcub;<br &sol;> &sol;&ast;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol;By default&comma; all arguments are parsed as strings&period; <&sol;span><&sol;strong><br &sol;> composable&lpar;<br &sol;><strong> "second&lowbar;screen&sol;&lbrace;title&rcub;"<&sol;strong><br &sol;> &rpar; &lbrace;<br &sol;> SecondScreen&lpar;navController &equals; navController&comma; <strong>it&period;arguments&quest;&period;getString&lpar;"title"&rpar;<&sol;strong>&rpar;<br &sol;> &rcub;&ast;&sol;<br &sol;><strong><span style&equals;"color&colon; &num;0000ff&semi;"> &sol;&sol;OR<&sol;span><&sol;strong> <br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol;You can specify another type by using the arguments parameter to set a type&period;<&sol;span><&sol;strong><br &sol;> composable&lpar;<br &sol;> <strong>"second&lowbar;screen&sol;&lbrace;title&rcub;"<&sol;strong>&comma;<br &sol;> <strong> arguments &equals; listOf&lpar;navArgument&lpar;"title"&rpar;<&sol;strong><br &sol;><strong> &lbrace;<&sol;strong><br &sol;><strong> type &equals; NavType&period;StringType<&sol;strong><br &sol;><strong> &rcub;&rpar;<&sol;strong><br &sol;> &rpar; &lbrace;<br &sol;> SecondScreen&lpar;navController &equals; navController&comma; <strong>it&period;arguments&quest;&period;getString&lpar;"title"&rpar;<&sol;strong>&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<p>5&period; Using data passed as a parameter to Second Screen composable&period;<&sol;p> &NewLine;<pre>&commat;Composable<br &sol;>fun SecondScreen&lpar;navController&colon; NavController&comma;<strong> title&colon; String&quest;<&sol;strong>&rpar; &lbrace;<br &sol;> Column&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> verticalArrangement &equals; Arrangement&period;Center&comma;<br &sol;> horizontalAlignment &equals; Alignment&period;CenterHorizontally<br &sol;> &rpar; &lbrace;<br &sol;> Text&lpar;<br &sol;><span style&equals;"color&colon; &num;0000ff&semi;"><strong> text &equals; title&period;toString&lpar;&rpar;&comma;<&sol;strong><&sol;span><br &sol;> fontSize &equals; 40&period;sp&comma;<br &sol;> color &equals; Color&period;Magenta&comma;<br &sol;> fontWeight &equals; FontWeight&period;Bold<br &sol;> &rpar;<br &sol;> Button&lpar;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to first screen<&sol;span><&sol;strong><br &sol;> navController&period;navigate&lpar;"first&lowbar;screen"&rpar;<br &sol;> &rcub; <br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to First Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<h4><span style&equals;"color&colon; &num;000080&semi;"><strong>Complete MainActivity code<&sol;strong><&sol;span><&sol;h4> &NewLine;<p>6&period; The below MainActivity file shows you how to pass string data from the First screen composable to the Second screen composable using Navigation compose&period;<&sol;p> &NewLine;<p><strong><span style&equals;"color&colon; &num;0000ff&semi;">MainActivity&period;kt<&sol;span><&sol;strong><&sol;p> &NewLine;<pre>class MainActivity &colon; ComponentActivity&lpar;&rpar; &lbrace;<br &sol;> override fun onCreate&lpar;savedInstanceState&colon; Bundle&quest;&rpar; &lbrace;<br &sol;> super&period;onCreate&lpar;savedInstanceState&rpar;<br &sol;> setContent &lbrace;<br &sol;> JetpackComposePassArgumentExpTheme &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; A surface container using the 'background' color from the theme<&sol;span><&sol;strong><br &sol;> Surface&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> color &equals; MaterialTheme&period;colors&period;background<br &sol;> &rpar; &lbrace;<br &sol;> MainScreen&lpar;&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;>&commat;Composable<br &sol;>fun MainScreen&lpar;&rpar; &lbrace;<br &sol;> val navController &equals; rememberNavController&lpar;&rpar;<br &sol;><br &sol;> NavHost&lpar;<br &sol;> navController &equals; navController&comma;<br &sol;> startDestination &equals; "first&lowbar;screen"<br &sol;> &rpar; &lbrace;<br &sol;> composable&lpar;"first&lowbar;screen"&rpar; &lbrace;<br &sol;> FirstScreen&lpar;navController &equals; navController&rpar;<br &sol;> &rcub;<br &sol;> composable&lpar;<br &sol;> "second&lowbar;screen&sol;&lbrace;title&rcub;"&comma;<br &sol;> arguments &equals; listOf&lpar;navArgument&lpar;"title"&rpar;<br &sol;> &lbrace;<br &sol;> type &equals; NavType&period;StringType<br &sol;> &rcub;&rpar;<br &sol;> &rpar; &lbrace;<br &sol;> SecondScreen&lpar;navController &equals; navController&comma; it&period;arguments&quest;&period;getString&lpar;"title"&rpar;&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;><br &sol;>&commat;Composable<br &sol;>fun FirstScreen&lpar;navController&colon; NavController&rpar; &lbrace;<br &sol;><br &sol;> Column&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> verticalArrangement &equals; Arrangement&period;Center&comma;<br &sol;> horizontalAlignment &equals; Alignment&period;CenterHorizontally<br &sol;> &rpar; &lbrace;<br &sol;> Text&lpar;<br &sol;> text &equals; "First Screen"&comma;<br &sol;> fontSize &equals; 40&period;sp&comma;<br &sol;> color &equals; Color&period;Blue&comma;<br &sol;> fontWeight &equals; FontWeight&period;Bold<br &sol;> &rpar;<br &sol;><br &sol;> Button&lpar;<br &sol;> shape &equals; RoundedCornerShape&lpar;8&period;dp&rpar;&comma;<br &sol;> modifier &equals; Modifier&period;padding&lpar;all &equals; Dp&lpar;8F&rpar;&rpar;&comma;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to second screen<&sol;span><&sol;strong><br &sol;> navController&period;navigate&lpar;"second&lowbar;screen&sol;Second Screen"&rpar;<br &sol;> &rcub;&comma;<br &sol;> colors &equals; ButtonDefaults&period;buttonColors&lpar;<br &sol;> backgroundColor &equals; Color&period;Blue&comma;<br &sol;> contentColor &equals; Color&period;White<br &sol;> &rpar;<br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to Second Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;><br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;>&commat;Composable<br &sol;>fun SecondScreen&lpar;navController&colon; NavController&comma; title&colon; String&quest;&rpar; &lbrace;<br &sol;> Column&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> verticalArrangement &equals; Arrangement&period;Center&comma;<br &sol;> horizontalAlignment &equals; Alignment&period;CenterHorizontally<br &sol;> &rpar; &lbrace;<br &sol;> Text&lpar;<br &sol;> text &equals; title&period;toString&lpar;&rpar;&comma;<br &sol;> fontSize &equals; 40&period;sp&comma;<br &sol;> color &equals; Color&period;Magenta&comma;<br &sol;> fontWeight &equals; FontWeight&period;Bold<br &sol;> &rpar;<br &sol;><br &sol;> Button&lpar;<br &sol;> shape &equals; RoundedCornerShape&lpar;8&period;dp&rpar;&comma;<br &sol;> modifier &equals; Modifier&period;padding&lpar;all &equals; Dp&lpar;8F&rpar;&rpar;&comma;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to first screen<&sol;span><&sol;strong><br &sol;> navController&period;navigate&lpar;"first&lowbar;screen"&rpar;<br &sol;> &rcub;&comma;<br &sol;> colors &equals; ButtonDefaults&period;buttonColors&lpar;<br &sol;> backgroundColor &equals; Color&period;Magenta&comma;<br &sol;> contentColor &equals; Color&period;White<br &sol;> &rpar;<br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to First Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<h4><span style&equals;"color&colon; &num;000080&semi;"><strong>Adding optional arguments<&sol;strong><&sol;span><&sol;h4> &NewLine;<p>Navigation Compose also supports optional navigation arguments&period; Optional arguments differ from required arguments in two ways&colon;<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;98&period;1 -->&NewLine;<div class&equals;"quads-location quads-ad2" id&equals;"quads-ad2" style&equals;"float&colon;none&semi;margin&colon;0px&semi;">&NewLine;&NewLine;<&sol;div>&NewLine; &NewLine;<ul> &NewLine;<li>They must be included using query parameter syntax &lpar;&&num;8220&semi;&quest;argName&equals;&lbrace;argName&rcub;&&num;8221&semi;&rpar;<&sol;li> &NewLine;<li>They must have a defaultValue set&comma; or have nullability &equals; true &lpar;which implicitly sets the default value to null&rpar;<&sol;li> &NewLine;<&sol;ul> &NewLine;<p>7&period; Passing optional data from First Screen composable to Second Screen composable&period;<&sol;p> &NewLine;<pre>&commat;Composable<br &sol;>fun FirstScreen&lpar;navController&colon; NavController&rpar; &lbrace;<br &sol;> Button&lpar;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to second screen<&sol;span><&sol;strong><br &sol;><span style&equals;"color&colon; &num;0000ff&semi;"> <strong>navController&period;navigate&lpar;"second&lowbar;screen&quest;title &equals; Second Screen"&rpar;<&sol;strong><&sol;span><br &sol;> &rcub; <br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to Second Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<p>8&period; Retrieving optional data passed from First Screen composable in the composable&lpar;&rpar; function of route <strong><span style&equals;"color&colon; &num;0000ff&semi;">second&lowbar;screen<&sol;span><&sol;strong> and pass it as a parameter to Second Screen composable&period; You must have some default value&comma; in case&comma; if there is no argument passed to the destination&comma; the defaultValue of &&num;8220&semi;Second Screen&&num;8221&semi; will be used instead&period;<&sol;p> &NewLine;<pre>&commat;Composable<br &sol;>fun MainScreen&lpar;&rpar; &lbrace;<br &sol;> val navController &equals; rememberNavController&lpar;&rpar;<br &sol;><br &sol;> NavHost&lpar;<br &sol;> navController &equals; navController&comma;<br &sol;> startDestination &equals; "first&lowbar;screen"<br &sol;> &rpar; &lbrace;<br &sol;> composable&lpar;"first&lowbar;screen"&rpar; &lbrace;<br &sol;> FirstScreen&lpar;navController &equals; navController&rpar;<br &sol;> &rcub;<br &sol;> <br &sol;> composable&lpar;<br &sol;> <strong><span style&equals;"color&colon; &num;0000ff&semi;">"second&lowbar;screen&quest;title&equals;&lbrace;title&rcub;"<&sol;span><&sol;strong>&comma;<br &sol;> arguments &equals; listOf&lpar;navArgument&lpar;"title"&rpar;<br &sol;> &lbrace;<br &sol;> type &equals; NavType&period;StringType<br &sol;> <strong><span style&equals;"color&colon; &num;0000ff&semi;">defaultValue &equals; "Second Screen"<&sol;span><&sol;strong><br &sol;> &rcub;&rpar;<br &sol;> &rpar; &lbrace;<br &sol;> SecondScreen&lpar;navController &equals; navController&comma; <strong><span style&equals;"color&colon; &num;0000ff&semi;">it&period;arguments&quest;&period;getString&lpar;"title"&rpar;<&sol;span><&sol;strong>&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<h4><strong><span style&equals;"color&colon; &num;000080&semi;">Complete MainActivity code<&sol;span><&sol;strong><&sol;h4> &NewLine;<p>9&period; The below MainActivity file shows you how to pass optional string data from the First screen composable to the Second screen composable using Navigation compose&period;<&sol;p> &NewLine;<p><strong><span style&equals;"color&colon; &num;0000ff&semi;">MainActivity&period;kt<&sol;span><&sol;strong><&sol;p> &NewLine;<pre>class MainActivity &colon; ComponentActivity&lpar;&rpar; &lbrace;<br &sol;> override fun onCreate&lpar;savedInstanceState&colon; Bundle&quest;&rpar; &lbrace;<br &sol;> super&period;onCreate&lpar;savedInstanceState&rpar;<br &sol;> setContent &lbrace;<br &sol;> JetpackComposePassArgumentExpTheme &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; A surface container using the 'background' color from the theme<&sol;span><&sol;strong><br &sol;> Surface&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> color &equals; MaterialTheme&period;colors&period;background<br &sol;> &rpar; &lbrace;<br &sol;> MainScreen&lpar;&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;>&commat;Composable<br &sol;>fun MainScreen&lpar;&rpar; &lbrace;<br &sol;> val navController &equals; rememberNavController&lpar;&rpar;<br &sol;><br &sol;> NavHost&lpar;<br &sol;> navController &equals; navController&comma;<br &sol;> startDestination &equals; "first&lowbar;screen"<br &sol;> &rpar; &lbrace;<br &sol;> composable&lpar;"first&lowbar;screen"&rpar; &lbrace;<br &sol;> FirstScreen&lpar;navController &equals; navController&rpar;<br &sol;> &rcub;<br &sol;> composable&lpar;<br &sol;> <strong>"second&lowbar;screen&quest;title&equals;&lbrace;title&rcub;"&comma;<&sol;strong><br &sol;><strong> arguments &equals; listOf&lpar;navArgument&lpar;"title"&rpar;<&sol;strong><br &sol;><strong> &lbrace;<&sol;strong><br &sol;><strong> type &equals; NavType&period;StringType<&sol;strong><br &sol;><strong> defaultValue &equals; "Second Screen"<&sol;strong><br &sol;><strong> &rcub;&rpar;<&sol;strong><br &sol;> &rpar; &lbrace;<br &sol;><br &sol;> SecondScreen&lpar;navController &equals; navController&comma;<strong> it&period;arguments&quest;&period;getString&lpar;"title"&rpar;<&sol;strong>&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;><br &sol;>&commat;Composable<br &sol;>fun FirstScreen&lpar;navController&colon; NavController&rpar; &lbrace;<br &sol;><br &sol;> Column&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> verticalArrangement &equals; Arrangement&period;Center&comma;<br &sol;> horizontalAlignment &equals; Alignment&period;CenterHorizontally<br &sol;> &rpar; &lbrace;<br &sol;> Text&lpar;<br &sol;> text &equals; "First Screen"&comma;<br &sol;> fontSize &equals; 40&period;sp&comma;<br &sol;> color &equals; Color&period;Blue&comma;<br &sol;> fontWeight &equals; FontWeight&period;Bold<br &sol;> &rpar;<br &sol;><br &sol;> Button&lpar;<br &sol;> shape &equals; RoundedCornerShape&lpar;8&period;dp&rpar;&comma;<br &sol;> modifier &equals; Modifier&period;padding&lpar;all &equals; Dp&lpar;8F&rpar;&rpar;&comma;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to second screen<&sol;span><&sol;strong><br &sol;><strong> navController&period;navigate&lpar;"second&lowbar;screen&quest;title &equals; Second Screen"&rpar;<&sol;strong><br &sol;> &rcub;&comma;<br &sol;> colors &equals; ButtonDefaults&period;buttonColors&lpar;<br &sol;> backgroundColor &equals; Color&period;Blue&comma;<br &sol;> contentColor &equals; Color&period;White<br &sol;> &rpar;<br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to Second Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;><br &sol;> &rcub;<br &sol;>&rcub;<br &sol;><br &sol;>&commat;Composable<br &sol;>fun SecondScreen&lpar;navController&colon; NavController&comma;<strong><span style&equals;"color&colon; &num;008000&semi;"> title&colon; String&quest;<&sol;span><&sol;strong>&rpar; &lbrace;<br &sol;> Column&lpar;<br &sol;> modifier &equals; Modifier&period;fillMaxSize&lpar;&rpar;&comma;<br &sol;> verticalArrangement &equals; Arrangement&period;Center&comma;<br &sol;> horizontalAlignment &equals; Alignment&period;CenterHorizontally<br &sol;> &rpar; &lbrace;<br &sol;> Text&lpar;<br &sol;> text &equals; title&period;toString&lpar;&rpar;&comma;<br &sol;> fontSize &equals; 40&period;sp&comma;<br &sol;> color &equals; Color&period;Magenta&comma;<br &sol;> fontWeight &equals; FontWeight&period;Bold<br &sol;> &rpar;<br &sol;><br &sol;> Button&lpar;<br &sol;> shape &equals; RoundedCornerShape&lpar;8&period;dp&rpar;&comma;<br &sol;> modifier &equals; Modifier&period;padding&lpar;all &equals; Dp&lpar;8F&rpar;&rpar;&comma;<br &sol;> onClick &equals; &lbrace;<br &sol;><strong><span style&equals;"color&colon; &num;008000&semi;"> &sol;&sol; this will navigate to first screen<&sol;span><&sol;strong><br &sol;> navController&period;navigate&lpar;"first&lowbar;screen"&rpar;<br &sol;> &rcub;&comma;<br &sol;> colors &equals; ButtonDefaults&period;buttonColors&lpar;<br &sol;> backgroundColor &equals; Color&period;Magenta&comma;<br &sol;> contentColor &equals; Color&period;White<br &sol;> &rpar;<br &sol;> &rpar;<br &sol;> &lbrace;<br &sol;> Text&lpar;text &equals; "Go to First Screen"&comma; fontSize &equals; 25&period;sp&rpar;<br &sol;> &rcub;<br &sol;> &rcub;<br &sol;>&rcub;<&sol;pre> &NewLine;<p>When you run the app it will look like this&colon;<&sol;p> &NewLine;<p><img class&equals;"alignnone wp-image-3255" src&equals;"https&colon;&sol;&sol;c1ctech&period;com&sol;wp-content&sol;uploads&sol;2022&sol;05&sol;Screenshot&lowbar;2022-05-28-21-16-45-802&lowbar;com&period;c1ctech&period;jetpackcomposenavigationexp1-473x1024&period;png" alt&equals;"" width&equals;"293" height&equals;"634" &sol;>      <img class&equals;"alignnone wp-image-3268" src&equals;"https&colon;&sol;&sol;c1ctech&period;com&sol;wp-content&sol;uploads&sol;2022&sol;05&sol;Screenshot&lowbar;2022-05-29-21-53-56-369&lowbar;com&period;c1ctech&period;jetpackcomposepassargumentexp1-473x1024&period;png" alt&equals;"" width&equals;"293" height&equals;"634" &sol;><&sol;p> &NewLine;<p>&nbsp&semi;<&sol;p> &NewLine;<p>&nbsp&semi;<&sol;p> &NewLine; &NewLine; &NewLine; &NewLine;<p>&nbsp&semi;<&sol;p> &NewLine;&NewLine;

Exit mobile version