bottomSheetView static method

Future bottomSheetView(
  1. BuildContext context, {
  2. required Widget child,
  3. double maxHeight = 0.8,
  4. double minHeight = 0.1,
  5. bool roundedFromTop = false,
  6. bool isDismissible = true,
  7. bool enableDrag = true,
  8. Color? barrierColor,
  9. Color? backgroundColor,
  10. double? elevation,
  11. Clip? clipBehavior,
  12. bool isSafeAreaFromBottom = false,
})

Implementation

static Future bottomSheetView(BuildContext context,
    {required Widget child,
    double maxHeight = 0.8,
    double minHeight = 0.1,
    bool roundedFromTop = false,
    bool isDismissible = true,
    bool enableDrag = true,
    Color? barrierColor,
    Color? backgroundColor,
    double? elevation,
    Clip? clipBehavior,
    bool isSafeAreaFromBottom = false}) {
  return showModalBottomSheet(
    context: context,
    barrierColor: barrierColor,
    clipBehavior: clipBehavior,
    elevation: elevation,
    enableDrag: enableDrag,
    shape: roundedFromTop
        ? const RoundedRectangleBorder(
            borderRadius: BorderRadius.vertical(top: Radius.circular(25.0)))
        : null,
    isScrollControlled: true,
    isDismissible: isDismissible,
    backgroundColor:
        backgroundColor ?? Theme.of(context).colorScheme.background,
    builder: (BuildContext context) {
      return SafeArea(
        bottom: isSafeAreaFromBottom,
        child: AnimatedPadding(
          padding: MediaQuery.viewInsetsOf(context),
          duration: const Duration(milliseconds: 100),
          child: _VxBottomSheetView(
            maxHeight: maxHeight,
            minHeight: minHeight,
            child: child,
          ),
        ),
      );
    },
  );
}