load_switch 2.2.0
load_switch: ^2.2.0 copied to clipboard
A highly customizable toggle switch with a loading state. Useful when getting data from remote calls.
2.2.0 Controller Support #
- 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
2.1.1 Refactor deprecated code #
- Replace
withOpacitywithwithValues
2.1.0 New spin styles #
- 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.9 #
onError(error): Callback when the Future throws an error- Internal code optimization and clean up
2.0.8 Bug fixes #
onTap(bool): Will always trigger even if the toggle is not active
2.0.7 Bug fixes #
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.6 New features #
- Adds new parameter
isActiveto choose whether the toggle is active and can be interacted - Tweaks
switchDecoration&thumbDecorationto also expose the activity status
2.0.5 Fixes screenshots #
2.0.4 Adds screenshots & Allows higher than 3.0.0 SDK version #
2.0.3 New features #
- Adds
thumbSizeRatio(0 - 1) to control the size of the thumb
Default:

thumbSizeRation = 0.8

2.0.2 New features #
- Adds
isLoadingflag to manually change the loading state when needed
2.0.1 Bug fixes #
- Fixes switch not updating when
valuewas changed
2.0.0 Breaking changes #
- 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.0 Adds tests #
1.1.1 Minor changes #
- Updates flutter_lints dependency
1.1.0 Breaking change #
- Removes unnecessary parent widgets (
Scaffold&Center).
1.0.1 #
- Removes forgotten print outputs.
1.0.0 #
- Initial release

































