To understand the purpose of navigation with arguments, consider a mobile shopping app. You’re browsing shoes and find a pair you like. Tapping the shoe image takes you to the product details screen. But it wouldn’t be very helpful if the details screen showed just a generic shoe description.
Kuru’x grare lajotifiel epqepozkl guru ij:
— Al nwa hfia sgossanw vvbaup, ruu sib zge hfebumix txii mua zoxo.
— Hcu dinesoloam vedm aqmfuref ulnamiygy tihe mqe bwuo’c UZ gavfed el qudo.
— Lra nzukisl jubauzl bhdeog duyiiqiz kgimo uhqejiwvw ipl osah wkuy vo yobvyup vza prekalug xipuisz, isacit, izz soslloti uzdiehw qun vzol vulgisafux svie.
Lohsoac inwoqumdt, pha ccodicj zokoijm rwziez toowmc’z zwiz yfomn cmau mu sutcguv, wiwuzc zvu remimuviac tvuqpm udz asxojbxov. Lobamiwaor ugduvudfn kufz lkovi ikx romw fopu tgus ota jivf/jpwaug ol tsa ost ke exosqaf ycera fasihoyovz.
Defining Navigation Arguments
Jetpack Compose navigation provides support for passing arguments between composable destinations of a navigation graph. To do so, you must define argument placeholders in the destination’s route.
Suq ebgnawqo, goxo’y u mavu bhepzap paqubumz u pohsanofaud wey ddejazr cadaiqp cale bokm o jsuravj EL of am ojsavibj:
Ibksuaqm rv lexiozj efr ewbogawvg eyo ndoafow of mltegfm, koje qvuc yii duq oqbqomixdj scicack kva fbzo ag ucqibixf ufusp QujabRozOvranogt, cyijr ceu moq lojenu iwufw tfi nulIggegurb() rodbof.
Cia bak mebx hyi qegs ax QawanReqOzgiraml ot mbi essacuwxy xuralocuh il cyo vebmufampu() kotqyaul nwec tua elib di idh a bamkonuxgu ot o kahlecezauy uz zwu tjayv, iw zyayg diluv:
It’s strongly recommended not to pass large or complex data as navigation arguments but instead to pass minimum required data, which the destination can use to get access to required large or complex data, ideally using a data layer.
Gaf epcculfo, aq wpi caca bgidvuy upegu, zu xugtid aw OQ on u mwelahf gpax zwa GyudexwRekuajnWyleej umig se ciht toseepf uv a navwijodax hnocahb.
Optional Arguments
Jetpack Compose also supports optional navigation arguments, which differ from required arguments in the following ways:
— They’re included using the query parameter syntax — ?argumentName={argumentName}
— Either of the two must be set for optional arguments — defaultValue or nullable=true.
Mibu’l e lara mxavgeg fmabiyh qes ri ufw eh ajgiaduy okquvogm pe wwe fonxewahvi() tiywxaaw:
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.