showCustomModalBottomSheet<T> function
Future<T?>
showCustomModalBottomSheet<T>({
- required BuildContext context,
- required WidgetBuilder builder,
- required WidgetWithChildBuilder containerWidget,
- Color? backgroundColor,
- double? elevation,
- ShapeBorder? shape,
- Clip? clipBehavior,
- Color? barrierColor,
- bool bounce = false,
- bool expand = false,
- AnimationController? secondAnimation,
- Curve? animationCurve,
- bool isDismissible = true,
- bool enableDrag = true,
- Duration? duration,
- RouteSettings? settings,
- double? closeProgressThreshold,
Shows a modal material design bottom sheet.
Implementation
Future<T?> showCustomModalBottomSheet<T>({
required BuildContext context,
required WidgetBuilder builder,
required WidgetWithChildBuilder containerWidget,
Color? backgroundColor,
double? elevation,
ShapeBorder? shape,
Clip? clipBehavior,
Color? barrierColor,
bool bounce = false,
bool expand = false,
AnimationController? secondAnimation,
Curve? animationCurve,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
RouteSettings? settings,
double? closeProgressThreshold,
}) async {
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final hasMaterialLocalizations =
Localizations.of<MaterialLocalizations>(context, MaterialLocalizations) !=
null;
final barrierLabel = hasMaterialLocalizations
? MaterialLocalizations.of(context).modalBarrierDismissLabel
: '';
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
.push(ModalSheetRoute<T>(
builder: builder,
bounce: bounce,
containerBuilder: containerWidget,
secondAnimationController: secondAnimation,
expanded: expand,
barrierLabel: barrierLabel,
isDismissible: isDismissible,
modalBarrierColor: barrierColor,
enableDrag: enableDrag,
animationCurve: animationCurve,
duration: duration,
settings: settings,
closeProgressThreshold: closeProgressThreshold,
));
return result;
}