FlutterToggleButton class

A customizable toggle button widget.

The FlutterToggleButton widget allows you to create a row of toggle buttons with various customization options for colors, gradients, text styles, and more.

Inheritance

Constructors

FlutterToggleButton({Key? key, required List items, double outerContainerMargin = 7.87, double buttonWidth = 139, double buttonHeight = 68, double borderRadius = 108, double buttonTextFontSize = 22, FontWeight enableTextFontWeight = FontWeight.w600, FontWeight disableTextFontWeight = FontWeight.w500, Color enableTextColor = Colors.white, Color disableTextColor = const Color(0xff7A7A7A), Color? outerContainerColor, Color? buttonColor, LinearGradient? outerContainerGradient, LinearGradient? buttonGradient, Color outerContainerBorderColor = Colors.transparent, double outerContainerBorderWidth = 0, Color buttonBorderColor = Colors.transparent, double buttonBorderWidth = 0, void onTap(int)?})
Creates a FlutterToggleButton widget.

Properties

borderRadius double
Border radius for buttons and outer container.
final
buttonBorderColor Color
Border color of the buttons.
final
buttonBorderWidth double
Border width of the buttons.
final
buttonColor Color?
Solid color for the buttons. Provide either this or buttonGradient, not both.
final
buttonGradient LinearGradient?
Gradient for the buttons. Provide either this or buttonColor, not both.
final
buttonHeight double
Height of each button.
final
buttonTextFontSize double
Font size of the button text.
final
buttonWidth double
Width of each button.
final
disableTextColor Color
Text color when the button is disabled.
final
disableTextFontWeight FontWeight
Font weight of the text when the button is disabled.
final
enableTextColor Color
Text color when the button is enabled.
final
enableTextFontWeight FontWeight
Font weight of the text when the button is enabled.
final
hashCode int
The hash code for this object.
no setterinherited
items List
List of items to display as buttons. Each item can be a String, int, double, or Widget.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap → void Function(int)?
Callback function when a button is tapped.
final
outerContainerBorderColor Color
Border color of the outer container.
final
outerContainerBorderWidth double
Border width of the outer container.
final
outerContainerColor Color?
Solid color for the outer container. Provide either this or outerContainerGradient, not both.
final
outerContainerGradient LinearGradient?
Gradient for the outer container. Provide either this or outerContainerColor, not both.
final
outerContainerMargin double
Margin around the outer container.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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