SectionSwitcher class

A composite widget that combines a SegmentedControl with an AnimatedSwitcher.

Inheritance

Constructors

SectionSwitcher({Key? key, required List<NavigationItem> items, SectionSwitcherController? controller, int initialIndex = 0, double segmentedHeight = 40.0, double segmentedItemSpacing = 4.0, EdgeInsets contentPadding = EdgeInsets.zero, EdgeInsets segmentedMargin = EdgeInsets.zero, SegmentedControlStyle? segmentedControlStyle, Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeInOut, ValueChanged<int>? onPageChanged})
const

Properties

contentPadding → EdgeInsets
The padding applied around the page content area, below the control bar. Defaults to EdgeInsets.zero.
final
controller → SectionSwitcherController?
A controller to programmatically manage the selected section.
final
curve → Curve
The animation curve used for all transitions. Defaults to Curves.easeInOut.
final
duration → Duration
The duration for all animations, including the indicator slide and the page cross-fade. Defaults to 300 milliseconds.
final
hashCode → int
The hash code for this object.
no setterinherited
initialIndex → int
The index of the item and page to display initially. Defaults to 0. This property is ignored if a controller is provided.
final
items → List<NavigationItem>
A list of NavigationItem objects, each defining a page and its corresponding segment appearance (icon and label).
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPageChanged → ValueChanged<int>?
A callback that is invoked when the selected page changes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segmentedControlStyle → SegmentedControlStyle?
The style to apply to the SegmentedControl.
final
segmentedHeight → double
The height of the SegmentedControl bar. Defaults to 40.0.
final
segmentedItemSpacing → double
The horizontal spacing between the icon and label within each segment. Defaults to 4.0.
final
segmentedMargin → EdgeInsets
The outer margin surrounding the SegmentedControl bar. Defaults to EdgeInsets.zero.
final

Methods

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