FlutterSwitch class

Inheritance

Constructors

FlutterSwitch({Key? key, required bool value, required ValueChanged<bool> onToggle, String? activeText = "On", String? inactiveText = "Off", Color activeColor = Colors.blue, Color inactiveColor = Colors.grey, Color activeTextColor = Colors.white70, Color inactiveTextColor = Colors.white70, FontWeight activeTextFontWeight = FontWeight.w900, FontWeight inactiveTextFontWeight = FontWeight.w900, Color toggleColor = Colors.white, Color? activeToggleColor, Color? inactiveToggleColor, double width = 70.0, double height = 35.0, double toggleSize = 25.0, double valueFontSize = 12.0, double borderRadius = 20.0, double padding = 4.0, bool showOnOff = false, Duration duration = const Duration(milliseconds: 200), bool disabled = false, Widget? activeIcon, Widget? inactiveIcon, BoxBorder? switchBorder, BoxBorder? toggleBorder})
const

Properties

activeColor Color
final
activeIcon Widget?
final
activeText String?
final
activeTextColor Color
final
activeTextFontWeight FontWeight
final
activeToggleColor Color?
final
borderRadius double
final
disabled bool
final
duration Duration
final
hashCode int
The hash code for this object.
no setterinherited
height double
final
inactiveColor Color
final
inactiveIcon Widget?
final
inactiveText String?
final
inactiveTextColor Color
final
inactiveTextFontWeight FontWeight
final
inactiveToggleColor Color?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onToggle ValueChanged<bool>
final
padding double
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showOnOff bool
final
switchBorder BoxBorder?
final
toggleBorder BoxBorder?
final
toggleColor Color
final
toggleSize double
final
value bool
final
valueFontSize double
final
width double
final

Methods

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