showCustomSBBModalSheet<T> function

Future<T?> showCustomSBBModalSheet<T>({
  1. required BuildContext context,
  2. required Widget header,
  3. required Widget child,
  4. bool useRootNavigator = true,
  5. bool useSafeArea = true,
  6. bool enableDrag = true,
  7. bool showCloseButton = true,
  8. Color? backgroundColor,
  9. BoxConstraints? constraints,
})

Shows an SBB Modal Sheet. Use according to documentation.

If you try to close the sheet but the underlying page is navigated back instead, try using the rootNavigator parameter of the Navigator:

Navigator.of(context, rootNavigator: true).pop(result)

See also:

Implementation

Future<T?> showCustomSBBModalSheet<T>({
  required BuildContext context,
  required Widget header,
  required Widget child,
  bool useRootNavigator = true,
  bool useSafeArea = true,
  bool enableDrag = true,
  bool showCloseButton = true,
  Color? backgroundColor,
  BoxConstraints? constraints,
}) {
  return showModalBottomSheet<T>(
    context: context,
    isScrollControlled: true,
    backgroundColor: SBBColors.transparent,
    useRootNavigator: useRootNavigator,
    useSafeArea: useSafeArea,
    enableDrag: enableDrag,
    constraints: constraints,
    builder: (BuildContext context) {
      return SBBModalSheet.custom(
        header: header,
        showCloseButton: showCloseButton,
        backgroundColor: backgroundColor,
        child: useSafeArea ? _wrapWithBottomSafeArea(child) : child,
      );
    },
    barrierColor: SBBInternal.barrierColor,
  );
}