Hi, is anything similar in compose like Flutter Na...
# compose
k
Hi, is anything similar in compose like Flutter Navigation ? for example opening different Scaffolds directly ?
j
k
Sorry i forgot to mention, Actually i had already checked this, it is like current(JetpackNavigation) navigation graph, but while working on Flutter’s Navigation api i have found that its great in some cases like for simple apps, because in flutter’s way we can easily pass Data between different screens directly through Constructor arguments and also we receive result back pretty easily. Flutter Navigation
for example in flutter we can do something like this Starting and listening for result
Copy code
int result = await Navigator.push(
    context,
    MaterialPageRoute(builder: (context) => SecondRoute(data: something)),
  );
on Second Route or screen
Copy code
Navigator.of(context).pop(5);// sending 5 as result
s
If you're hacking something quick and dirty, you could just do this https://stackoverflow.com/a/65619560/9440211. Otherwise no, this solution doesn't allow passing entire objects. Also mentioned here by Ian Lake https://kotlinlang.slack.com/archives/CJLTWPH7S/p1612475129357900?thread_ts=1612469332.356500&cid=CJLTWPH7S about how it should be implemented instead.
i
Navigation Compose is specifically designed to save and restore your state exactly as it is over configuration changes and process death and recreation. That certainly affects the API that is offered
👍 2
💯 2
c
That's actually a super great point Ian. I guess I've always figured that, but nice to see it in writing. 💯