bottomSheetModal<T> function

Future<T?> bottomSheetModal<T>(
  1. BuildContext context,
  2. WidgetBuilder scrollBuilder, {
  3. bool displayDragHandle = true,
})

Implementation

Future<T?> bottomSheetModal<T>(
  BuildContext context,
  WidgetBuilder scrollBuilder, {
  bool displayDragHandle = true,
}) {
  switch (context.screenType) {
    case rb.DeviceScreenType.desktop:
      return showPlatformDialog<T>(
        context: context,
        useRootNavigator: true,
        barrierDismissible: true,
        builder: memoizeWidgetBuilder(
          (context) => Center(
            child: Layout.container()
                .borderRadiusAll(16)
                .backgroundColor(Colors.white)
                .padAll(sunnySpacing * 2)
                .single(
                  Container(
                    child: SizedBox(
                      width: 600.px,
                      height: 600.px,
                      child: scrollBuilder(context),
                    ),
                  ),
                ),
          ),
        ),
      );
    default:
      return showCupertinoModalBottomSheet<T>(
        context: context,
        useRootNavigator: true,
        enableDrag: true,
        isDismissible: true,
        builder: memoizeScrollBuild(scrollBuilder),
      );
  }
}