CommonDialog constructor

CommonDialog({
  1. Key? key,
  2. Widget? contentChild,
  3. String? title,
  4. TextAlign? titleAlign,
  5. TextStyle? titleStyle,
  6. double? titleFontSize,
  7. Color? titleColor,
  8. String? content,
  9. TextAlign? contentAlign,
  10. TextStyle? contentStyle,
  11. double? contentFontSize,
  12. Color? contentColor,
  13. String? leftButton,
  14. TextStyle? leftButtonTextStyle,
  15. VoidCallback? onLeftButtonPressed,
  16. String? rightButton,
  17. TextStyle? rightButtonTextStyle,
  18. VoidCallback? onRightButtonPressed,
  19. bool disableCloseEvent = false,
})

Implementation

CommonDialog(
    {Key? key,
    Widget? contentChild, //自定义content内容
    String? title, //标题。传null不显示
    TextAlign? titleAlign,
    TextStyle? titleStyle, //标题自定义样式
    double? titleFontSize, //标题字体大小。优先由titleStyle控制
    Color? titleColor, //标题字体颜色。优先由titleStyle控制
    String? content, //内容。传null不显示
    TextAlign? contentAlign,
    TextStyle? contentStyle, //内容自定义样式
    double? contentFontSize, //内容字体大小。优先由contentStyle控制
    Color? contentColor, //内容字体颜色。优先由contentStyle控制
    String? leftButton, //左下按钮。传null不显示
    TextStyle? leftButtonTextStyle, //左下按钮样式
    VoidCallback? onLeftButtonPressed, //左下按钮点击回调
    String? rightButton, //右下按钮
    TextStyle? rightButtonTextStyle, //右下按钮样式
    VoidCallback? onRightButtonPressed, //右下按钮点击回调
    bool disableCloseEvent = false // 是否屏蔽外部的关闭事件(默认:不屏蔽)
    })
    : super(
          key: key,
          backgroundColor: Colors.white,
          alignment: Alignment.center,
          insetPadding: EdgeInsets.zero,
          insetAnimationCurve: Curves.easeInToLinear,
          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
          child: WillPopScope(
              child: SizedBox(
                  width: ScreenUtils.screenWidthInDp() * 0.74,
                  child: _DialogView(
                      title: title,
                      titleAlign: titleAlign,
                      contentAlign: contentAlign,
                      titleStyle: titleStyle,
                      titleFontSize: titleFontSize,
                      titleColor: titleColor,
                      content: content,
                      contentStyle: contentStyle,
                      contentFontSize: contentFontSize,
                      contentColor: contentColor,
                      leftButton: leftButton,
                      leftButtonTextStyle: leftButtonTextStyle,
                      onLeftButtonPressed: onLeftButtonPressed,
                      rightButton: rightButton,
                      rightButtonTextStyle: rightButtonTextStyle,
                      onRightButtonPressed: onRightButtonPressed,
                      contentChild: contentChild)),
              onWillPop: () => Future<bool>.value(!disableCloseEvent)));