openDesktopMenu<T> function
Future<T?>
openDesktopMenu<T>(
- BuildContext context, {
- required WidgetBuilder builder,
- bool displayDragHandle = true,
- bool dismissible = true,
- bool draggable = true,
- PathRouteSettings? settings,
- double? width,
- double? height,
- bool expand = false,
- bool nestModals = false,
- Constraints? constraints,
Implementation
Future<T?> openDesktopMenu<T>(
BuildContext context, {
required WidgetBuilder builder,
bool displayDragHandle = true,
bool dismissible = true,
bool draggable = true,
PathRouteSettings? settings,
double? width,
double? height,
bool useRootNavigator = true,
bool expand = false,
bool nestModals = false,
Constraints? constraints,
}) {
width ??= 600.px;
height ??= 570.px;
return showPlatformDialog<T>(
context: context,
useRootNavigator: useRootNavigator,
barrierDismissible: dismissible,
routeSettings: settings,
builder: memoizeWidgetBuilder(
(context) => Center(
child: Layout.container()
.borderRadiusAll(16)
.backgroundColor(
expand == false ? Colors.transparent : sunnyColors.white)
.single(
Container(
padding: EdgeInsets.all(16),
child: SizedBox(
width: width,
height: height,
child: Center(child: builder(context)),
),
),
),
),
),
);
}