show<T> static method
Future<T?>
show<T>(
- BuildContext context, {
- required WidgetBuilder builder,
- bool showDragHandle = true,
Presents a modal bottom sheet and completes with the popped result.
Implementation
static Future<T?> show<T>(
BuildContext context, {
required WidgetBuilder builder,
bool showDragHandle = true,
}) {
final M3EThemeData theme =
M3EThemeScope.resolveOf(context) ?? M3ETheme.of(context);
final sheetTheme = theme.bottomSheetTheme;
return showGeneralDialog<T>(
context: context,
barrierDismissible: true,
barrierLabel: 'Dismiss',
barrierColor: sheetTheme.scrimColor(theme.colorScheme),
transitionDuration: M3EMotion.long1,
pageBuilder: (BuildContext context, _, _) {
return M3EScrimSystemUi.wrapBottomSheet(
M3EComponentTheme(
builder: (context) => Align(
alignment: Alignment.bottomCenter,
child: M3EBottomSheet(
showDragHandle: showDragHandle,
child: Builder(builder: builder),
),
),
),
);
},
transitionBuilder:
(BuildContext context, Animation<double> a, _, Widget c) {
return SlideTransition(
position:
Tween<Offset>(
begin: const Offset(0, 1),
end: Offset.zero,
).animate(
CurvedAnimation(
parent: a,
curve: M3EMotion.emphasizedDecelerate,
),
),
child: c,
);
},
);
}