TDButton class

TD常规按钮

Inheritance

Constructors

TDButton({Key? key, String? text, TDButtonSize size = TDButtonSize.medium, TDButtonType type = TDButtonType.fill, TDButtonShape shape = TDButtonShape.rectangle, TDButtonTheme? theme, Widget? child, bool disabled = false, bool isBlock = false, TDButtonStyle? style, TDButtonStyle? activeStyle, TDButtonStyle? disableStyle, TextStyle? textStyle, TextStyle? disableTextStyle, double? width, double? height, TDButtonEvent? onTap, IconData? icon, Widget? iconWidget, TDButtonEvent? onLongPress, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding})
const

Properties

activeStyle TDButtonStyle?
自定义点击样式,有则优先用它,没有则根据type和theme选取
final
child Widget?
自控件
final
disabled bool
禁止点击
final
disableStyle TDButtonStyle?
自定义禁用样式,有则优先用它,没有则根据type和theme选取
final
disableTextStyle TextStyle?
自定义不可点击状态文本样式
final
hashCode int
The hash code for this object.
no setterinherited
height double?
自定义高度
final
icon IconData?
图标icon
final
iconWidget Widget?
自定义图标icon控件
final
isBlock bool
是否为通栏按钮
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
自定义margin
final
onLongPress TDButtonEvent?
长按事件
final
onTap TDButtonEvent?
点击事件
final
padding EdgeInsetsGeometry?
自定义padding
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape TDButtonShape
形状:圆角,胶囊,方形,圆形,填充
final
size TDButtonSize
尺寸
final
style TDButtonStyle?
自定义样式,有则优先用它,没有则根据type和theme选取
final
text String?
文本内容
final
textStyle TextStyle?
自定义可点击状态文本样式
final
theme TDButtonTheme?
主题
final
type TDButtonType
类型:填充,描边,文字
final
width double?
自定义宽度
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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