show static method

void show(
  1. BuildContext context, {
  2. BetterPopupPosition position = BetterPopupPosition.bottom,
  3. Color? backgroundColor,
  4. double? width,
  5. double? height,
  6. Widget? child,
  7. BorderRadiusGeometry? borderRadius,
  8. bool isShowCloseIcon = false,
  9. double? closeIconSize,
  10. Color? closeIconColor,
  11. bool isDismissible = true,
  12. Widget? closeIcon,
  13. EdgeInsets? padding,
  14. List<BoxShadow>? boxShadow,
  15. VoidCallback? onClose,
  16. bool? enableDrag,
})

Implementation

static void show(
  BuildContext context, {

  /// 弹出层的位置
  BetterPopupPosition position = BetterPopupPosition.bottom,

  /// 弹出层的背景颜色
  Color? backgroundColor,

  /// 弹出层的宽度
  double? width,

  /// 弹出层的高度
  double? height,

  /// 弹出层的子组件
  Widget? child,

  /// 弹出层的圆角半径
  BorderRadiusGeometry? borderRadius,

  /// 是否显示关闭图标
  bool isShowCloseIcon = false,

  /// 关闭图标的大小
  double? closeIconSize,

  /// 关闭图标的颜色
  Color? closeIconColor,

  bool isDismissible = true,
  Widget? closeIcon,

  /// 弹出层的内边距
  EdgeInsets? padding,

  /// 弹出层的阴影
  final List<BoxShadow>? boxShadow,

  /// 关闭回调
  VoidCallback? onClose,

  /// 是否启用拖拽,仅支持底部弹出
  bool? enableDrag,
}) {
  if (position == BetterPopupPosition.bottom) {
    _showBottomPopup(
      context,
      backgroundColor: backgroundColor,
      height: height,
      width: width,
      child: child,
      borderRadius: borderRadius,
      isShowCloseIcon: isShowCloseIcon,
      closeIconSize: closeIconSize,
      closeIconColor: closeIconColor,
      isDismissible: isDismissible,
      closeIcon: closeIcon,
      padding: padding,
      boxShadow: boxShadow,
      onClose: onClose,
      enableDrag: enableDrag,
    );
    return;
  }
  _showPopup(
    context,
    position: position,
    backgroundColor: backgroundColor,
    height: height,
    width: width,
    child: child,
    borderRadius: borderRadius,
    isShowCloseIcon: isShowCloseIcon,
    closeIconSize: closeIconSize,
    closeIconColor: closeIconColor,
    isDismissible: isDismissible,
    closeIcon: closeIcon,
    padding: padding,
    boxShadow: boxShadow,
    onClose: onClose,
  );
}