load_switch
A highly customizable toggle switch with a loading state. Useful when getting data from remote calls.
3.1.0
5.0K downloads/mo
#3829 most downloaded on pub.dev
esentis/load_switch
What this package is like to depend on
Last release 1 months ago
20 Jul 2026
Release timing varies
gaps range from 2 weeks to 12 months
Most releases are documented
notes for 14 of 19 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
19 releases · first in 2022
2 releases in the last 12 months
see the full history below
Release timeline
19 releases · Apr 2022 to Jul 2026Releases
latest 19-
3.1.020 Jul 2026Release notes
Open source →- Fix caller-owned LoadSwitchController left loading forever when a
controlled switch was disposed, changed mode, or swapped mid-toggle - Fix managed switch stranded loading after isLoading returned to default
- SpinStyle.cupertino now honors spinColor; waveSpinner renders
SpinKitWaveSpinner - Directional thumb alignment for RTL, keyboard-reachable inactive
switches, focus indicator, focusNode/autofocus/focusColor and
configurable semantic hints - Stricter constructor assertions for dimensions, stroke width and
animation durations - Test suite 23 -> 47; core library at 100% line coverage
Release notes
Open source →Bug fixes
- Fixes a caller-owned
LoadSwitchControllerbeing left loading forever when aLoadSwitch.controlledwas disposed, changed mode, or had its controller swapped while an async toggle was still in flight. The widget now tracks the controller whose loading state it switched on and always hands it back - Fixes a managed switch staying loading forever after being rebuilt from
isLoading: trueback to the default. An omittedisLoadingnow means "not loading" instead of "do not synchronize"; loading driven by the widget's own toggle is tracked separately and is unaffected SpinStyle.cupertinonow honorsspinColorinstead of ignoring itSpinStyle.waveSpinnernow rendersSpinKitWaveSpinnerinstead of duplicatingSpinStyle.waveStart
UI and accessibility
- The thumb now uses directional alignment, so the switch lays out correctly in right-to-left locales
- Inactive switches are reachable by keyboard, so keyboard users get the same
onTapfeedback pointer users already had - Adds a keyboard focus indicator, plus
focusNode,autofocusandfocusColor - Adds
semanticLabel,loadingSemanticHintanddisabledSemanticHintfor configurable screen reader announcements
Quality
- Constructors now reject non-positive or non-finite
width,heightandspinStrokeWidth, and negative animation durations - Documents that
spinnerAnimationDurationdoes not affect the native Material and Cupertino indicators, which animate at a fixed rate - Adds
LoadSwitchController.clearLoadingAfterFrame(), used by the widget to release loading during teardown without notifying listeners while the widget tree is locked - Test suite grown from 23 to 47 tests; core library is now at 100% line coverage
- Fix caller-owned LoadSwitchController left loading forever when a
-
3.0.010 Apr 2026Release notes
Open source →Breaking API changes
- Replaces the overloaded
LoadSwitchconstructor with explicitLoadSwitch.managedandLoadSwitch.controlledmodes - Renames
futuretoonToggleandonChangetoonChanged - Splits
animationDurationintoswitchAnimationDurationandspinnerAnimationDuration - Changes
onErrorto include bothObjectandStackTrace - Aligns
LoadSwitchController.executeWithLoading()naming with the widget API
Bug fixes
- Fixes controller ownership bugs when swapping between managed and controlled modes
- Hardens async updates against dispose and stale controller writes
- Prevents managed switches from becoming tappable again after a parent rebuild while an async toggle is still in flight
- Fixes spinner sizing, including the Cupertino spinner radius
UI and accessibility
- Adds keyboard activation support
- Uses proper switch-style
toggledsemantics instead of checkbox-style semantics
Quality and tooling
- Expands tests to cover controller behavior, lifecycle, async regressions, semantics, and all spinner styles
- Raises the minimum supported SDKs to Dart 3.6 and Flutter 3.27
Docs and examples
- Updates the README and examples for the new API
- Migration guide for the breaking changes is available in the README
- Replaces the overloaded
-
2.2.010 Apr 2025Release notes
Open source →- Adds
LoadSwitchControllerfor programmatic control of the switch - Switch now supports both controlled and uncontrolled modes
- Controller features:
- Programmatic value toggling via
toggle()method - Loading state management via
executeWithLoading() - External observation of state changes via
addListener() - Programmatic control of active state
- Programmatic value toggling via
- Example usage with controller pattern included
- Adds
-
2.1.128 Feb 2025 -
2.1.024 Feb 2024Release notes
Open source →-
🤡 Add LoadSwitch examples with default and custom styles
-
✨ Add new loading spinner styles
-
⬆️ ➕ Update version and add flutter_spinkit dependency
Release notes
Open source →- New parameter
style. The library extends flutter_spinkit internally adding some fancy spin animations. Keep in mind you can also edit thethumbDecoration&switchDecorationfor different color & shapes. The examples have the default circular thumb with white color. The default style isSpinStyle.material.
material cupertino chasingDots circle cubeGrid dancingSquare doubleBounce dualRing fadingCircle fadingCube fadingFour fadingGrid foldingCube hourGlass pianoWave pouringHourGlass pulse pulsingGrid pumpingHeart ring ripple rotatingCircle rotatingPlain spinningCircle spinningLines squareCircle threeBounce threeInOut wanderingCubes waveStart waveCenter waveEnd waveSpinner -
-
2.0.923 Feb 2024 -
2.0.814 Dec 2023 -
2.0.727 Oct 2023Release notes
Open source →onTap(bool)will trigger before the future, theboolis the value of the switch when tappedonChange(bool)will trigger after the future, theboolis the response of the future
-
2.0.621 Sep 2023Release notes
Open source →- Adds new parameter
isActiveto choose whether the toggle is active and can be interacted - Tweaks
switchDecoration&thumbDecorationto also expose the activity status
- Adds new parameter
-
2.0.526 May 2023Nothing published for this version
-
2.0.426 May 2023Nothing published for this version
-
2.0.308 May 2023Release notes
Open source →- Adds
thumbSizeRatio(0 - 1) to control the size of the thumb
Default:
<img src="https://i.imgur.com/LdHfQU4.png" width="350px"></img>
thumbSizeRation = 0.8<img src="https://i.imgur.com/0FJ185A.png" width="350px"></img>
- Adds
-
2.0.204 May 2023 -
2.0.102 May 2023 -
2.0.021 Apr 2023Release notes
Open source →- Simplifies API by removing redundant parameters.
- Fixes dimension issues when specifying height and width to the switch.
- Removes tests for now
Check the README for the examples.
-
1.2.021 Jan 2023Nothing published for this version
-
1.1.016 May 2022 -
1.0.108 May 2022Nothing published for this version
-
1.0.013 Apr 2022Nothing published for this version