bottomSheetOptions static method
Future
bottomSheetOptions(
- BuildContext context, {
- List<
String> ? option, - String? defaultData,
- double maxHeight = 0.8,
- double minHeight = 0.1,
- dynamic onSelect()?,
- bool roundedFromTop = false,
- bool isDismissible = true,
- bool enableDrag = true,
- Color? barrierColor,
- Color? backgroundColor,
- double? elevation,
- Clip? clipBehavior,
- bool isSafeAreaFromBottom = false,
Implementation
static Future bottomSheetOptions(BuildContext context,
{List<String>? option,
String? defaultData,
double maxHeight = 0.8,
double minHeight = 0.1,
Function(int index, String value)? onSelect,
bool roundedFromTop = false,
bool isDismissible = true,
bool enableDrag = true,
Color? barrierColor,
Color? backgroundColor,
double? elevation,
Clip? clipBehavior,
bool isSafeAreaFromBottom = false}) async {
final result = await showModalBottomSheet(
context: context,
barrierColor: barrierColor,
elevation: elevation,
clipBehavior: clipBehavior,
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: _VxBottomSheetOptions(
list: option,
initData: defaultData,
maxHeight: maxHeight,
minHeight: minHeight,
),
),
);
},
);
if (onSelect != null && result is List) {
onSelect(result.first, result.last);
}
return result;
}