QsButton class

支持普通、选中和禁用状态的按钮组件。

Inheritance

Constructors

QsButton({Key? key, double? width, double? height, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, Color? normalBackgroundColor, Color? selectedBackgroundColor, Color? disabledBackgroundColor, bool isCircle = false, bool isClipsToBounds = true, BorderRadiusGeometry? outerRadius, BorderRadiusGeometry? innerRadius, BoxBorder? border, List<BoxShadow>? boxShadows, Gradient? gradient, BoxConstraints? constraints, bool isSelected = false, bool isEnabled = true, Widget? normalChild, Widget? selectedChild, Widget? disabledChild, VoidCallback? onTap})
创建一个多状态按钮。
const

Properties

border BoxBorder?
按钮边框。
final
boxShadows List<BoxShadow>?
按钮阴影列表。
final
constraints BoxConstraints?
按钮的额外尺寸约束。
final
disabledBackgroundColor Color?
禁用状态下的背景颜色。
final
disabledChild Widget?
禁用状态下显示的子组件,未设置时使用 normalChild
final
gradient Gradient?
按钮背景渐变。
final
hashCode int
The hash code for this object.
no setterinherited
height double?
按钮高度。
final
innerRadius BorderRadiusGeometry?
按钮内容的裁剪圆角,主要用于图片等内容。
final
isCircle bool
是否使用圆形外观。
final
isClipsToBounds bool
是否裁剪超出按钮边界的内容。
final
isEnabled bool
按钮当前是否可用。
final
isSelected bool
按钮当前是否处于选中状态。
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
按钮外边距。
final
normalBackgroundColor Color?
普通状态下的背景颜色。
final
normalChild Widget?
普通状态下显示的子组件。
final
onTap VoidCallback?
按钮点击回调。
final
outerRadius BorderRadiusGeometry?
按钮外层装饰圆角。
final
padding EdgeInsetsGeometry?
按钮内边距。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedBackgroundColor Color?
选中状态下的背景颜色。
final
selectedChild Widget?
选中状态下显示的子组件,未设置时使用 normalChild
final
width double?
按钮宽度。
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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