PackageTrack
Sign in Get early access

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 2026
2023 2024 2025 2026
Release Pre-release

Releases

latest 19
  1. 3.1.0 20 Jul 2026
    Release notes
    • 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
    Open source →
    Release notes

    Bug fixes

    • Fixes a caller-owned LoadSwitchController being left loading forever when a LoadSwitch.controlled was 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: true back to the default. An omitted isLoading now means "not loading" instead of "do not synchronize"; loading driven by the widget's own toggle is tracked separately and is unaffected
    • SpinStyle.cupertino now honors spinColor instead of ignoring it
    • SpinStyle.waveSpinner now renders SpinKitWaveSpinner instead of duplicating SpinStyle.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 onTap feedback pointer users already had
    • Adds a keyboard focus indicator, plus focusNode, autofocus and focusColor
    • Adds semanticLabel, loadingSemanticHint and disabledSemanticHint for configurable screen reader announcements

    Quality

    • Constructors now reject non-positive or non-finite width, height and spinStrokeWidth, and negative animation durations
    • Documents that spinnerAnimationDuration does 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
    Open source →
  2. 3.0.0 10 Apr 2026
    Release notes

    ✨ Improve LoadSwitch and LoadSwitchController by refining value chang…

    Open source →
    Release notes

    Breaking API changes

    • Replaces the overloaded LoadSwitch constructor with explicit LoadSwitch.managed and LoadSwitch.controlled modes
    • Renames future to onToggle and onChange to onChanged
    • Splits animationDuration into switchAnimationDuration and spinnerAnimationDuration
    • Changes onError to include both Object and StackTrace
    • 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 toggled semantics 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
    Open source →
  3. 2.2.0 10 Apr 2025
    Release notes

    ✨ Refactor LoadSwitch to support LoadSwitchController and improve sta…

    Open source →
    Release notes
    • Adds LoadSwitchController for 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
    • Example usage with controller pattern included
    Open source →
  4. 2.1.1 28 Feb 2025
    Release notes

    🗑️ Remove 'flutter' topic from pubspec.yaml

    Open source →
    Release notes
    • Replace withOpacity with withValues
    Open source →
  5. 2.1.0 24 Feb 2024
    Release notes
    • 🤡 Add LoadSwitch examples with default and custom styles

    • ✨ Add new loading spinner styles

    • ⬆️ ➕ Update version and add flutter_spinkit dependency

    Open source →
    Release notes
    • New parameter style. The library extends flutter_spinkit internally adding some fancy spin animations. Keep in mind you can also edit the thumbDecoration & switchDecoration for different color & shapes. The examples have the default circular thumb with white color. The default style is SpinStyle.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
    Open source →
  6. 2.0.9 23 Feb 2024
    Release notes

    💚 Update Flutter and checkout actions

    Open source →
  7. 2.0.8 14 Dec 2023
    Release notes
    • onTap(bool) : Will always trigger even if the toggle is not active
    Open source →
  8. 2.0.7 27 Oct 2023
    Release notes
    • onTap(bool) will trigger before the future, the bool is the value of the switch when tapped
    • onChange(bool) will trigger after the future, the bool is the response of the future
    Open source →
  9. 2.0.6 21 Sep 2023
    Release notes
    • Adds new parameter isActive to choose whether the toggle is active and can be interacted
    • Tweaks switchDecoration & thumbDecoration to also expose the activity status
    Open source →
  10. 2.0.5 26 May 2023

    Nothing published for this version

  11. 2.0.4 26 May 2023

    Nothing published for this version

  12. 2.0.3 08 May 2023
    Release notes
    • 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>

    Open source →
  13. 2.0.2 04 May 2023
    Release notes
    • Adds isLoading flag to manually change the loading state when needed
    Open source →
  14. 2.0.1 02 May 2023
    Release notes
    • Fixes switch not updating when value was changed
    Open source →
  15. 2.0.0 21 Apr 2023
    Release notes
    • 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.

    Open source →
  16. 1.2.0 21 Jan 2023

    Nothing published for this version

  17. 1.1.0 16 May 2022
    Release notes
    • Removes unnecessary parent widgets (Scaffold & Center).
    Open source →
  18. 1.0.1 08 May 2022

    Nothing published for this version

  19. 1.0.0 13 Apr 2022

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive