MXButton class

------------------------------------------------------------------按钮组件 text 文字内容 themeEnum 按钮主题色 品牌色/错误色/警告色/成功色 afterClickButtonCallback 点击按钮执行的回调方法 afterOnLonePressButtonCallback 长按按钮执行的回调方法 slot 按钮的插槽类型为Weight 当设置插槽后无法再继续设置默认icon与自定义icon组件 icon 使用组件自带的icon组件 disabled 按钮是否处于禁用状态 customIconWidget 自定义icon组件 typeEnum 按钮的类型 填充/文字/外框线 shape 椭圆/矩形带圆角/圆形 sizeEnum 按钮的尺寸 大/中/小/迷你 loading 按钮的loading状态

Inheritance

Constructors

MXButton({Key? key, required String text, required MXButtonThemeEnum themeEnum, Widget? slot, IconData? icon, double? customWidth, bool disabled = false, Widget? customIconWidget, ButtonEvent? afterClickButtonCallback, ButtonEvent? afterOnLonePressButtonCallback, MXButtonShapeEnum shape = MXButtonShapeEnum.rect, MXButtonTypeEnum typeEnum = MXButtonTypeEnum.fill, MXButtonSizeEnum sizeEnum = MXButtonSizeEnum.medium, bool loading = false, EdgeInsets? customMargin, TextStyle? textStyle, double? customHeight, bool isLine = false})
const

Properties

afterClickButtonCallback → ButtonEvent?
点击后的方法 (短按)
final
afterOnLonePressButtonCallback → ButtonEvent?
点击后的方法 (长按)
final
customHeight → double?
自定义高度
final
customIconWidget → Widget?
自定义的icon组件
final
customMargin → EdgeInsets?
自定义按钮的margin距离
final
customWidth → double?
自定义宽度
final
disabled → bool
是否禁用按钮
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
使用组件自带的icon组件
final
isLine → bool
是否独占一行
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loading → bool
loading状态
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shape → MXButtonShapeEnum
按钮的形状
final
sizeEnum → MXButtonSizeEnum
按钮尺寸
final
slot → Widget?
按钮插槽。
final
text → String
按钮文字内容
final
textStyle → TextStyle?
final
themeEnum → MXButtonThemeEnum
按钮主题
final
typeEnum → MXButtonTypeEnum
按钮类型
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<MXButton>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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