flex_switch 1.1.1
flex_switch: ^1.1.1 copied to clipboard
A multi-option segmented control for Flutter. Keyboard accessible, RTL-aware, drag-to-select, themable, and fast.
Changelog #
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.1.1 - 2025-09-29 #
Thumb and overlay gutter now match outer padding at the track edges.
1.1.0 - 2025-09-16 #
Added proportional layout, drag commit options, and per-option disabling.
Added #
- Proportional layout:
FlexSwitchLayout.proportional
(segments sized to content). - Drag behavior controls:
DragCommitBehavior
(immediate vs. commit on release with preview).thumbDragOnly
to require drags to start on the selected thumb.
- Per-option disable:
SwitchOption.enabled
(dim + skip selection on drag). - Style:
thumbPressScale
,hideDividersAdjacentToThumb
,dividerFadeDuration
,dividerFadeCurve
.
Improved #
- Smoother label/icon transitions; avoids text reflow on weight change.
- Divider fade near the thumb; pressed feedback and pinned-edge thumb scale.
- Example app with new toggles and demos.
1.0.0 - 2025-09-15 #
Initial release.
Added #
- Core
FlexSwitch
widget with:- Boolean factory:
FlexSwitch.boolean
- Enum factory:
FlexSwitch.fromEnum
- Values factory:
FlexSwitch.fromValues
- Boolean factory:
- Drag-to-select across segments
- Full keyboard support (Left/Right, Home/End, Enter/Space), RTL-aware
- A11y with Semantics + focus ring
- Theming via
FlexSwitchStyle
(colors, radii, dividers, ripple, animation) - Example app under
example/