showGlassSheet<T> function

Future<T?> showGlassSheet<T>({
  1. required BuildContext context,
  2. required WidgetBuilder builder,
  3. bool showHandle = true,
  4. bool isDismissible = true,
  5. bool enableDrag = true,
  6. EdgeInsetsGeometry padding = const EdgeInsets.fromLTRB(20, 4, 20, 20),
  7. bool useRootNavigator = true,
})

Shows a sheet of glass that floats up from the bottom, as iOS 26's: inset from the screen's edges, rounded all round, and dragged down to dismiss.

Resolves with the value the sheet is popped with.

Implementation

Future<T?> showGlassSheet<T>({
  required BuildContext context,
  required WidgetBuilder builder,
  bool showHandle = true,
  bool isDismissible = true,
  bool enableDrag = true,
  EdgeInsetsGeometry padding = const EdgeInsets.fromLTRB(20, 4, 20, 20),
  bool useRootNavigator = true,
}) {
  final carried = GlassOverlayContext.of(context);
  return Navigator.of(context, rootNavigator: useRootNavigator).push<T>(
    _GlassSheetRoute<T>(
      carried: carried,
      builder: builder,
      showHandle: showHandle,
      dismissible: isDismissible,
      enableDrag: enableDrag,
      padding: padding,
    ),
  );
}