How to do a modal presentation of a route in Flutter?
I figured out how to navigate to a route using the usual "push" transition, but I am struggling to implement a modal transition. See animation attached (done using native iOS). How do I present a screen modally (a screen that itself can be pushed more screens to).
See an example below. The transition I am struggling with is from "A" to "C" (and of course a way to dismiss it and go back to "A").
You can push like this: Navigator. of(context). push( CupertinoPageRoute( fullscreenDialog: true, builder: (context) => SomePage(), ), );
A route that blocks interaction with previous routes. ModalRoutes cover the entire Navigator. They are not necessarily opaque, however; for example, a pop-up menu uses a ModalRoute but only shows the menu in a small box overlapping the previous route. The T type argument is the return value of the route.
You can push like this:
Navigator.of(context).push( CupertinoPageRoute( fullscreenDialog: true, builder: (context) => SomePage(), ), );
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With