show static method

void show({
  1. Color? barrierColor,
  2. bool barrierDismissible = false,
  3. Color backgroundColor = Colors.transparent,
  4. Offset offset = const Offset(0, 0),
  5. Widget? child,
})

显示居中弹窗

参数:

  • barrierColor:弹窗背景颜色
  • barrierDismissible:是否点击背景关闭弹窗
  • backgroundColor:内容背景颜色
  • offset:弹窗偏移量
  • child:弹窗标题

Implementation

static void show({
  Color? barrierColor,
  bool barrierDismissible = false,
  Color backgroundColor = Colors.transparent,
  Offset offset = const Offset(0, 0),
  Widget? child,
}) {
  Get.dialog(
    ElasticDialog(
      backgroundColor: backgroundColor,
      offset: offset,
      child: child ?? const SizedBox(),
    ),
    barrierDismissible: barrierDismissible,
    barrierColor: barrierColor ?? Colors.black.withValues(alpha: 0.8),
  );
}