showGlassActionSheet<T> function
- required BuildContext context,
- Widget? title,
- Widget? message,
- required List<
GlassActionSheetAction> actions, - GlassActionSheetAction? cancel,
- bool barrierDismissible = true,
- String semanticLabel = 'Actions',
Shows an action sheet that springs up from the bottom over a dimmed
page, as iOS's do: a group of actions under an optional title and
message, and a cancel button of its own below them.
Resolves with the chosen action's result, or null when the sheet is
dismissed with a tap outside it or the Escape key.
Implementation
Future<T?> showGlassActionSheet<T>({
required BuildContext context,
Widget? title,
Widget? message,
required List<GlassActionSheetAction> actions,
GlassActionSheetAction? cancel,
bool barrierDismissible = true,
String semanticLabel = 'Actions',
bool useRootNavigator = true,
}) {
final carried = GlassOverlayContext.of(context);
final reduceMotion = MediaQuery.maybeDisableAnimationsOf(context) ?? false;
return Navigator.of(context, rootNavigator: useRootNavigator).push<T>(
_GlassActionSheetRoute<T>(
carried: carried,
dismissible: barrierDismissible,
reduceMotion: reduceMotion,
sheet: GlassActionSheet(
title: title,
message: message,
actions: actions,
cancel: cancel,
semanticLabel: semanticLabel,
),
),
);
}