showCommandModalBottomSheet<T> function
Future<T?>
showCommandModalBottomSheet<T>({
- required BuildContext context,
- required WidgetBuilder builder,
- Color? backgroundColor,
- Color? barrierColor,
- double? elevation,
- ShapeBorder? shape,
- Clip clipBehavior = Clip.antiAlias,
- BoxConstraints? constraints,
- bool isScrollControlled = true,
- bool isDismissible = true,
- bool enableDrag = true,
- bool showDragHandle = true,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
- AnimationController? transitionAnimationController,
Shows a Command menu inside a mobile modal bottom sheet with automatic keyboard insets handling, drag-to-dismiss support, and customizable presentation.
Implementation
Future<T?> showCommandModalBottomSheet<T>({
required BuildContext context,
required WidgetBuilder builder,
Color? backgroundColor,
Color? barrierColor,
double? elevation,
ShapeBorder? shape,
Clip clipBehavior = Clip.antiAlias,
BoxConstraints? constraints,
bool isScrollControlled = true,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
bool showDragHandle = true,
bool useSafeArea = true,
RouteSettings? routeSettings,
AnimationController? transitionAnimationController,
}) {
return showModalBottomSheet<T>(
context: context,
builder: (context) {
final viewInsets = MediaQuery.of(context).viewInsets;
return Padding(
padding: EdgeInsets.only(bottom: viewInsets.bottom),
child: builder(context),
);
},
backgroundColor: backgroundColor,
barrierColor: barrierColor,
elevation: elevation,
shape:
shape ??
const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16.0)),
),
clipBehavior: clipBehavior,
constraints: constraints,
isScrollControlled: isScrollControlled,
useRootNavigator: useRootNavigator,
isDismissible: isDismissible,
enableDrag: enableDrag,
showDragHandle: showDragHandle,
useSafeArea: useSafeArea,
routeSettings: routeSettings,
transitionAnimationController: transitionAnimationController,
);
}