DHSwitch class

Inheritance

Constructors

DHSwitch({Key? key, required bool value, ValueChanged<bool>? onChanged, bool disabled = false, Color activeThumbColor = const Color(0xFFFFFFFF), Color inactiveThumbColor = const Color(0xFFFFFFFF), Color activeTrackColor = const Color(0xFF47D7EC), Color inactiveTrackColor = const Color(0xFFF0F0F0), Color borderColor = const Color(0x1A000000), SwitchSize switchSize = const SwitchSize(), BorderStyle borderStyle = BorderStyle.solid, AnimationStatusListener? onAnimationStatusChanged})

Properties

activeThumbColor Color
开启状态thumb颜色
final
activeTrackColor Color
开启状态轨道颜色
final
borderColor Color
边框颜色
final
borderStyle BorderStyle
边框样式, BorderStyle.none不设置边框
final
disabled bool
是否可用
final
hashCode int
The hash code for this object.
no setterinherited
inactiveThumbColor Color
关闭状态thumb颜色
final
inactiveTrackColor Color
关闭状态轨道颜色
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onAnimationStatusChanged AnimationStatusListener?
动画状态改变
final
onChanged ValueChanged<bool>?
状态改变回调,未设置不会响应手势
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
switchSize SwitchSize
自定义switch尺寸
final
value bool
当前状态值
final

Methods

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