SegmentedControl constructor
const
SegmentedControl({
- Key? key,
- required List<
Widget> segments, - int initialIndex = 0,
- ValueChanged<
int> ? onSegmentSelected, - Duration duration = const Duration(milliseconds: 300),
- Curve curve = Curves.easeInOut,
- SegmentedControlStyle style = const SegmentedControlStyle(),
Creates a customizable animated segmented control.
Implementation
const SegmentedControl({
super.key,
required this.segments,
this.initialIndex = 0,
this.onSegmentSelected,
this.duration = const Duration(milliseconds: 300),
this.curve = Curves.easeInOut,
this.style = const SegmentedControlStyle(),
}) : assert(segments.length > 0, 'At least one segment is required.');