popup<T> method

Future<T?> popup<T>(
  1. Widget body, {
  2. double? height,
  3. double? maxHeight,
  4. BoxDecoration? decoration,
  5. double? borderRadius,
  6. EdgeInsetsGeometry? margin,
  7. EdgeInsetsGeometry? padding,
  8. Color? barrierColor,
  9. Color? backgroundColor,
  10. bool? isDismissible,
  11. bool? isScrollControlled,
  12. double? elevation,
  13. WidgetBuilder? dragHandlerBuilder,
  14. bool? showClose,
  15. PopupStyle? style,
  16. Widget? closeButton,
  17. 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,
      );
    },
  );
}