Showing
1 changed file
with
14 additions
and
7 deletions
@@ -78,15 +78,17 @@ Useful if you want a blurred transparent background as the example Cupertino Pho | @@ -78,15 +78,17 @@ Useful if you want a blurred transparent background as the example Cupertino Pho | ||
78 | > **Why?** | 78 | > **Why?** |
79 | > `MaterialPageRoute` and `CupertinoPageRoute` do not allow animated translation to/from routes that are not the same type. | 79 | > `MaterialPageRoute` and `CupertinoPageRoute` do not allow animated translation to/from routes that are not the same type. |
80 | 80 | ||
81 | -There are two options: | ||
82 | - | ||
83 | -### OPTION 1. Recommended. | ||
84 | 81 | ||
85 | Replace your current route class with `MaterialWithModalsPageRoute`. | 82 | Replace your current route class with `MaterialWithModalsPageRoute`. |
86 | 83 | ||
84 | + | ||
87 | Notice this route type behaves the same as `MaterialPageRoute` and supports custom `PageTransitionsBuilder` and `PageTransitionsTheme`. | 85 | Notice this route type behaves the same as `MaterialPageRoute` and supports custom `PageTransitionsBuilder` and `PageTransitionsTheme`. |
88 | 86 | ||
89 | -How can I change my route class? See cases: | 87 | + |
88 | + | ||
89 | +<details><summary> | ||
90 | + How can I replace my current route? </summary> | ||
91 | + | ||
90 | 92 | ||
91 | <details><summary> 1. | 93 | <details><summary> 1. |
92 | 94 | ||
@@ -145,9 +147,12 @@ Unfortunately this parameter uses `MaterialPageRoute` and `CupertinoPageRoute` r | @@ -145,9 +147,12 @@ Unfortunately this parameter uses `MaterialPageRoute` and `CupertinoPageRoute` r | ||
145 | You can modify the way you call the previous route with one of the previous methods or try option 2 | 147 | You can modify the way you call the previous route with one of the previous methods or try option 2 |
146 | 148 | ||
147 | </details> | 149 | </details> |
148 | - | 150 | + </details> |
151 | + | ||
152 | +Is there an alternative in case I can't change my current route? **Yes!** | ||
153 | +<details><summary> | ||
154 | + Learn how to animate previous route with CupertinoScaffold: </summary> | ||
149 | 155 | ||
150 | -### OPTION 2. | ||
151 | 156 | ||
152 | 1. Wrap previous route inside a `CupertinoScaffold`. | 157 | 1. Wrap previous route inside a `CupertinoScaffold`. |
153 | Example with `routes` parameter from `MaterialApp` or `CupertinoApp` | 158 | Example with `routes` parameter from `MaterialApp` or `CupertinoApp` |
@@ -162,7 +167,9 @@ You can modify the way you call the previous route with one of the previous meth | @@ -162,7 +167,9 @@ You can modify the way you call the previous route with one of the previous meth | ||
162 | CupertinoScaffold.showCupertinoModalBottomSheet(context:context, builder: (context) => Container()) | 167 | CupertinoScaffold.showCupertinoModalBottomSheet(context:context, builder: (context) => Container()) |
163 | ``` | 168 | ``` |
164 | 169 | ||
165 | -These two options won't work correctly together. | 170 | +Don't use this solution at the same time as `MaterialWithModalsPageRoute` |
171 | + | ||
172 | + </details> | ||
166 | 173 | ||
167 | It supports native features as bouncing, blurred background, dark mode, stacking modals and inside navigation. | 174 | It supports native features as bouncing, blurred background, dark mode, stacking modals and inside navigation. |
168 | 175 |
-
Please register or login to post a comment