DialogAction class

对话框操作按钮配置类

用于定义对话框按钮的样式和行为,可通过静态方法快速创建常用按钮

Constructors

DialogAction({bool close = false, required String title, Color? color, dynamic action()?})
创建对话框按钮

Properties

action → dynamic Function()?
按钮点击回调函数(可选)
final
close → bool
点击后是否自动关闭对话框
final
color → Color?
按钮背景颜色(可选)
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
title → String
按钮显示文本
final

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

accept({required String title, dynamic action()?, bool close = true}) → DialogAction
创建绿色确认操作按钮
cancel({required String title, dynamic action()?, bool close = true}) → DialogAction
创建灰色取消操作按钮
destroy({required String title, dynamic action()?, bool close = true}) → DialogAction
创建红色销毁操作按钮