showModalBottom static method
void
showModalBottom({})
Implementation
static void showModalBottom({
required Widget child,
Widget? title,
Widget? leading,
List<Widget>? actions,
Widget? bottom,
EdgeInsetsGeometry? padding,
double? minHeight,
bool showTitle = true,
bool isScrollControlled = true,
bool useSafeArea = true,
}) {
BoxConstraints? boxConstraints;
if (minHeight != null) {
boxConstraints = BoxConstraints(
minHeight: minHeight,
);
}
showModalBottomSheet(
context: Get.context!,
isScrollControlled: isScrollControlled,
useSafeArea: useSafeArea,
constraints: boxConstraints,
backgroundColor: Theme.of(Get.context!).dialogTheme.backgroundColor,
builder: (BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (showTitle)
ComTitleBar(
title: title,
leading: leading,
actions: actions,
),
if (bottom != null) bottom,
ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.8,
),
child: SingleChildScrollView(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom +
MediaQuery.of(context).viewInsets.bottom,
),
child: child,
),
),
],
);
},
);
}