BetterSwitch class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BetterSwitch
Constructors
-
BetterSwitch({Key? key, ValueChanged<
bool> ? onChanged, Future<bool> onUpdateChange()?, bool defaultValue = false, bool? loading = false, double? width, double? height, Color? ballBackgroundColor, Color? inactiveBackgroundColor, Color? activeBackgroundColor, EdgeInsetsGeometry? padding, double? loadingSize, double? loadingStrokeWidth, Color? loadingColor, Widget? ballWidget, bool? disabled = false}) -
const
Properties
- activeBackgroundColor → Color?
-
激活状态的背景颜色
final
- ballBackgroundColor → Color?
-
开关圆球的背景颜色
final
- ballWidget → Widget?
-
自定义圆球组件。如果提供,将替换内置的圆球
final
- defaultValue → bool
-
开关的默认值
final
- disabled → bool?
-
开关是否被禁用
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- inactiveBackgroundColor → Color?
-
非激活状态的背景颜色
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loading → bool?
-
开关是否处于加载状态
final
- loadingColor → Color?
-
加载指示器的颜色
final
- loadingSize → double?
-
加载指示器的大小
final
- loadingStrokeWidth → double?
-
加载指示器的描边宽度
final
-
onChanged
→ ValueChanged<
bool> ? -
开关状态改变时的回调函数
final
-
onUpdateChange
→ Future<
bool> Function()? -
使用 onUpdating Change 来异步控制开关状态
如果使用了 onUpdateChange,onChange 将被忽略
final
- padding → EdgeInsetsGeometry?
-
开关的内边距
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
开关的固定宽度
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BetterSwitch> -
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