popup<T> method
Future<T?>
popup<T>(
- Widget body, {
- double? height,
- double? maxHeight,
- BoxDecoration? decoration,
- double? borderRadius,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Color? barrierColor,
- Color? backgroundColor,
- bool? isDismissible,
- bool? isScrollControlled,
- double? elevation,
- WidgetBuilder? dragHandlerBuilder,
- bool? showClose,
- PopupStyle? style,
- Widget? closeButton,
- String? closeSemanticsLabel,
show a modal popup with body
witch width will fill the screen
Implementation
Future<T?> popup<T>(
Widget body, {
double? height,
double? maxHeight,
BoxDecoration? decoration,
double? borderRadius,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Color? barrierColor,
Color? backgroundColor,
bool? isDismissible,
bool? isScrollControlled,
double? elevation,
/// Build a Widget at top of the popup that
/// seems to responeding drag to close the popup
WidgetBuilder? dragHandlerBuilder,
bool? showClose,
PopupStyle? style,
Widget? closeButton,
String? closeSemanticsLabel,
}) {
final popupStyle = style ??
theme.popupStyle ??
MyDialog.theme.popupStyle ??
const PopupStyle();
return showModalBottomSheet<T>(
backgroundColor: Colors.transparent,
barrierColor: barrierColor ?? popupStyle.barrierColor,
elevation: elevation ?? popupStyle.elevation,
isDismissible: isDismissible ?? popupStyle.isDismissible ?? true,
isScrollControlled: isScrollControlled ?? false,
context: context,
builder: (BuildContext context) {
return PopupWidget(
height: height,
maxHeight: maxHeight,
style: popupStyle.copyWith(
decoration: decoration,
borderRadius: borderRadius,
margin: margin,
padding: padding,
backgroundColor: backgroundColor,
showClose: showClose,
),
closeButton: closeButton,
closeSemanticsLabel: closeSemanticsLabel ?? local.closeSemantics,
child: body,
);
},
);
}