cupertino.mdx
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## Cupertino Modal BottomSheet
iOS 13 came with an amazing new modal navigation and now it is available to use with Flutter.
```dart
showCupertinoModalBottomSheet(
context: context,
builder: (context) => Container(),
)
```
See generic paramameter in the Material section above
#### Cupertino specific params
The optional `backgroundColor` parameters can be passed in to customize the backgroundColor cupertino bottom sheets.
Useful if you want a blurred transparent background as the example Cupertino Photo Share
### CAUTION!: To animate the previous route some changes are needed.
> **Why?**
> `MaterialPageRoute` and `CupertinoPageRoute` do not allow animated translation to/from routes that are not the same type.
Replace your current route class with `MaterialWithModalsPageRoute`.
Notice this route type behaves the same as `MaterialPageRoute` and supports custom `PageTransitionsBuilder` and `PageTransitionsTheme`.
It supports native features as bouncing, blurred background, dark mode, stacking modals and inside navigation.
## Push new views inside the modal bottom sheet
a. If you want to push a new modal bottom sheet just call `showCupertinoModalBottomSheet` again (works with both options)
b. For inside navigaton add a new `Navigator` or `CupertinoTabScaffold` inside
c. Also it supports flutter features as WillPopScope to prevent the modal bottom to be closed.
## Build other BottomSheets
Try `showBarModalBottomSheet` for a bottomSheet with the appearance used by Facebook or Slack
Check in the example project `showAvatarModalBottomSheet` for how to create your own ModalBottomSheet
## Questions
[Ask a question](https://stackoverflow.com/questions/ask) and ping me @jamesblasco
## Found an issue or have a proposal?
[Create an issue](https://github.com/jamesblasco/modal_bottom_sheet/issues/new)