LabeledToggleSwitch class

Inheritance

Constructors

LabeledToggleSwitch.new({Key? key, required bool value, required void onChanged(bool), String activeLabel = 'Active', String inactiveLabel = 'Inactive', Color activeColor = Colors.green, Color inactiveColor = Colors.red, Color activeKnobBorderColor = Colors.white, Color inactiveKnobBorderColor = Colors.white, TextStyle? activeTextStyle, TextStyle? inactiveTextStyle, double height = 32, double knobSize = 20, double? width, Duration animationDuration = const Duration(milliseconds: 200), EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 4, horizontal: 6), Color? borderColor, double spacing = 8.0})
Constructor with default values for various parameters
const

Properties

activeColor Color
Colors for active and inactive states
final
activeKnobBorderColor Color
Knob Border color when toggle is active
final
activeLabel String
Labels for active and inactive states
final
activeTextStyle TextStyle?
Custom text styles for active and inactive labels
final
animationDuration Duration
Duration of the animation for switching states
final
borderColor Color?
Border color for the toggle switch
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height, knob size for the toggle switch
final
inactiveColor Color
final
inactiveKnobBorderColor Color
Border color when toggle is inactive
final
inactiveLabel String
final
inactiveTextStyle TextStyle?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
knobSize double
final
onChanged → void Function(bool)
Callback function to handle the toggle change
final
padding EdgeInsetsGeometry
Padding around the toggle switch
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spacing double
New spacing between children of Row (label - knob - label)
final
value bool
The current value of the toggle switch (active or inactive)
final
width double?
Width of the toggle switch, can be null to auto size based on content
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