- Fixes #119 & #113
- An optimized builder function.
- The
builder
param has changed from:
showMaterialModalBottomSheet(
context: context,
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container()
)
},
)
to
showMaterialModalBottomSheet(
context: context,
builder: (context) {
return SingleChildScrollView(
controller: ModalScrollController.of(context),
child: Container()
)
},
)
Now you can access the modal's scrollController from any inside widget like ModalScrollController.of(context)
.
- The
builder
param has changed from:
showMaterialModalBottomSheet(
context: context,
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container()
)
},
)
to
showMaterialModalBottomSheet(
context: context,
builder: (context) {
return SingleChildScrollView(
controller: ModalScrollController.of(context),
child: Container()
)
},
)
- Appart from the visual change, with this changes you can access the controller from every inner widget without having to pass the controller to every constructor. Also now the builder method will be called only once. Before it was calling multiple times while the modal was being animated.
- Fix bug when scrollview was not used
- Added support for scroll-to-top by tapping the status bar on iOS devices.
- Use
curveAnimation
to define a custom curve animation for the modal transition - Bug fixes releated to horizontal scroll, clamping physics and othes.
- Use
duration
to define the opening duration of the modal - Change the top radius of the cupertino bottom sheet Thanks to @bierbaumtim @troyanskiy @rodineijf for the contributions
- Support for closing a modal with a scroll view by dragging down fast.
- Fix assertion in CupertinoBottomSheet and BottomSheetRoute when using the CupetinoApp or WidgetsApp as root
- Fix assertion when scrollController isn't used by the builder