open<T> method

  1. @override
Future<T?> open<T>(
  1. BuildContext context, {
  2. required WidgetBuilder builder,
  3. bool displayDragHandle = true,
  4. bool dismissible = true,
  5. bool draggable = true,
  6. PathRouteSettings? settings,
  7. double? width,
  8. double? height,
  9. bool useRootNavigator = true,
  10. bool expand = false,
  11. bool nestModals = false,
  12. Constraints? constraints,
  13. dynamic extraOptions,
})
override

Implementation

@override
Future<T?> open<T>(
  BuildContext context, {
  required 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,
  extraOptions,
}) {
  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)),
                  ),
                ),
              ),
        ),
      ));
}