SwitchBarWidget class

🔹 SwitchBarWidget

Inheritance

Constructors

SwitchBarWidget({Key? key, required List<SwitchItem> items, int initialIndex = 0, double height = 60, BorderRadiusGeometry? borderRadius = const BorderRadius.all(Radius.circular(20)), double borderWidth = 1, Color? borderColor = Colors.transparent, Color? backgroundColor, Color? selectedColor = Colors.blueAccent, Color? unselectedColor, TextStyle? selectedLabelStyle = const TextStyle(color: Colors.blueAccent, fontSize: 12), TextStyle? unselectedLabelStyle = const TextStyle(color: Colors.black54, fontSize: 12), Duration duration = const Duration(milliseconds: 280), bool isCupertinoStyle = false, bool isVertical = true, EdgeInsetsGeometry padding = EdgeInsets.zero, EdgeInsetsGeometry margin = const EdgeInsets.only(top: 10, bottom: 10), double itemSpacing = 5, void onSelected(SwitchItem item, int index)?, EdgeInsetsGeometry pagePadding = const EdgeInsets.only(top: 10), BorderRadiusGeometry pageBorderRadius = const BorderRadius.all(Radius.circular(5)), bool isSwipToChangePage = true, double? itemBoxHeight, IndicatorType indicatorType = IndicatorType.oval, double indicatorWidthFactor = 0.6, double indicatorHeight = 2.0, double dotSize = 6.0, double indicatorOvalBorder = 10, bool isShowLabel = false, double? indicatorSpace = 4})
const

Properties

backgroundColor → Color?
final
borderColor → Color?
final
borderRadius → BorderRadiusGeometry?
final
borderWidth → double
final
dotSize → double
final
duration → Duration
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
final
indicatorHeight → double
final
indicatorOvalBorder → double
final
indicatorSpace → double?
final
indicatorType → IndicatorType
final
indicatorWidthFactor → double
final
initialIndex → int
final
isCupertinoStyle → bool
final
isShowLabel → bool
final
isSwipToChangePage → bool
final
isVertical → bool
final
itemBoxHeight → double?
final
items → List<SwitchItem>
final
itemSpacing → double
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin → EdgeInsetsGeometry
final
onSelected → void Function(SwitchItem item, int index)?
final
padding → EdgeInsetsGeometry
final
pageBorderRadius → BorderRadiusGeometry
final
pagePadding → EdgeInsetsGeometry
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedColor → Color?
final
selectedLabelStyle → TextStyle?
final
unselectedColor → Color?
final
unselectedLabelStyle → TextStyle?
final

Methods

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