showFluent2Sheet<T> function
Future<T?>
showFluent2Sheet<T>(
- BuildContext context, {
- required Widget builder(
- BuildContext context,
- VoidCallback close
- DesignSheetEdge edge = DesignSheetEdge.end,
- double width = Fluent2ChromeMetrics.drawerWidth,
Raises the Fluent2Sheet builder makes at the window's edge, width
wide (never closer than 56 to the far side), over the overlay, sliding in
on ui_core's spring (settling in Fluent's durationGentle; a drag let go
settles at its speed). The builder gets the sheet's close. Escape, a press
on the overlay or a drag to its edge closes it and the focus goes back
where it was.
showFluent2Sheet<void>(context, builder: (context, close) => Fluent2Sheet(title: 'Filters', onClose: close, child: filters))
Implementation
Future<T?> showFluent2Sheet<T>(
BuildContext context, {
required Widget Function(BuildContext context, VoidCallback close) builder,
DesignSheetEdge edge = DesignSheetEdge.end,
double width = Fluent2ChromeMetrics.drawerWidth,
}) {
final t = context.fluent2Theme;
final navigator = Fluent2Host.navigatorOf(context);
final themes = InheritedTheme.capture(from: context, to: navigator.context);
return navigator.push<T>(
DesignSideSheetRoute<T>(
edge: edge,
width: width,
barrierColor: t.overlay,
barrierLabel: DesignLocalizations.of(context).modalBarrierDismissLabel,
dampingRatio: Fluent2Motion.springDamping,
stiffness: Fluent2Motion.springGentle,
builder: (inner, sheet) => themes.wrap(
RoutePresentationScope(
presentation: RoutePresentation.sheet,
child: builder(inner, sheet.close),
),
),
),
);
}