DialogManager class

是对话框显示的管理类。 根据底部按钮的数量分为:单个按钮对话框、两个按钮对话框 和 不定按钮对话框

通用属性: showIcon 是否展示 头部Icon,会展示默认的 对号图片 iconWidget 头部icon的图片,如果设置了这个属性 即使showIcon为false也会展示 设置的图片

title 是展示的标题文案 titleWidget 展示的标题widget,如果设置了widget 则会以widget为准

message 中间的辅助信息文案 messageWidget 展示中间辅助信息的widget

warning 警示文案 warningWidget 展示警示文案的widget

dismiss 点击按钮后是否 消失弹窗

barrierDismissible 点击四周的黑色遮罩 是否关闭弹窗

titleMaxLines 标题的最大行数

Constructors

DialogManager()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

showConfirmDialog(BuildContext context, {required String cancel, required String confirm, bool showIcon = false, Image? iconWidget, String? title, Widget? titleWidget, String? message, Widget? messageWidget, String? warning, Widget? warningWidget, Widget? cancelWidget, Widget? conformWidget, GestureTapCallback? onCancel, GestureTapCallback? onConfirm, bool barrierDismissible = true, int titleMaxLines = cTitleMaxLines, DialogConfig? themeData}) → void
展示底部有两个按钮的弹窗 左侧是cancel 右侧是confirm cancel 左侧显示的文案 confirm 右侧显示的文案 cancelWidget 自定义显示的左侧 conformWidget 自定义显示的右侧
showMoreButtonDialog(BuildContext context, {required List<String> actions, bool showIcon = false, Image? iconWidget, String? title, Widget? titleWidget, String? message, Widget? messageWidget, String? warning, Widget? warningWidget, List<Widget>? actionsWidget, bool barrierDismissible = true, int titleMaxLines = cTitleMaxLines, DialogConfig? themeData, DialogIndexedActionClickCallback? indexedActionClickCallback}) → void
展示底部按钮为多个的dialog 如果设置的是文字按钮那么,每个按钮的点击通过indexedActionClickCallback处理 如果底部按钮的数量小于等于2 ,会以横排展示,否则会议竖排展示 如果数量超过了三个 会滑动展示
showSingleButtonDialog(BuildContext context, {required String label, bool showIcon = false, Image? iconWidget, String? title, Widget? titleWidget, String? message, Widget? messageWidget, String? warning, Widget? warningWidget, Widget? labelWidget, GestureTapCallback? onTap, bool barrierDismissible = true, int titleMaxLines = cTitleMaxLines, DialogConfig? themeData}) → void
展示底部只有一个按钮的对话框 对话框的点击回调是onTap label 底部按钮的文案 labelWidget 自定义底部按钮的显示