bottomSheetView static method
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,
})
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).backgroundColor,
builder: (BuildContext context) {
return SafeArea(
bottom: isSafeAreaFromBottom,
child: AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 100),
child: _VxBottomSheetView(
child: child,
maxHeight: maxHeight,
minHeight: minHeight,
),
),
);
},
);
}