@@ -25,6 +25,7 @@ Future<bool> _getFuture() async {
25
25
LoadSwitch(
26
26
value: value,
27
27
future: _getFuture,
28
+ style: SpinStyle.material
28
29
onChange: (v) {
29
30
value = v;
30
31
print('Value changed to $v');
@@ -44,6 +45,7 @@ LoadSwitch(
44
45
LoadSwitch(
45
46
value: value,
46
47
future: _getFuture,
48
+ style: SpinStyle.material
47
49
curveIn: Curves.easeInBack,
48
50
curveOut: Curves.easeOutBack,
49
51
animationDuration: const Duration(milliseconds: 500),
@@ -92,6 +94,54 @@ onTap: (v) {
92
94
),
93
95
```
94
96
97
+ ## Spin styles
98
+
99
+ The library extends [ flutter_spinkit] ( https://pub.dev/packages/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 ` .
100
+
101
+ | material | cupertino | chasingDots |
102
+ | ------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------- |
103
+ | ![ material] ( https://i.imgur.com/i80tb2n.gif " material ") | ![ cupertino] ( https://i.imgur.com/ciOjjIx.gif " cupertino ") | ![ chasingDots] ( https://i.imgur.com/VnVZ7yW.gif " chasingDots ") |
104
+
105
+ | circle | cubeGrid | dancingSquare |
106
+ | --------------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------- |
107
+ | ![ circle] ( https://i.imgur.com/ePBR9xB.gif " circle ") | ![ cubeGrid] ( https://i.imgur.com/HhoyjuA.gif " cubeGrid ") | ![ dancingSquare] ( https://i.imgur.com/huQGF7f.gif " dancingSquare ") |
108
+
109
+ | doubleBounce | dualRing | fadingCircle |
110
+ | --------------------------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------- |
111
+ | ![ doubleBounce] ( https://i.imgur.com/XoNKCUb.gif " doubleBounce ") | ![ dualRing] ( https://i.imgur.com/YODTtaw.gif " dualRing ") | ![ fadingCircle] ( https://i.imgur.com/xMFMI6F.gif " fadingCircle ") |
112
+
113
+ | fadingCube | fadingFour | fadingGrid |
114
+ | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
115
+ | ![ fadingCube] ( https://i.imgur.com/s6jqcBy.gif " fadingCube ") | ![ fadingFour] ( https://i.imgur.com/1gL9G70.gif " fadingFour ") | ![ fadingGrid] ( https://i.imgur.com/HLHTVRw.gif " fadingGrid ") |
116
+
117
+ | foldingCube | hourGlass | pianoWave |
118
+ | ------------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
119
+ | ![ foldingCube] ( https://i.imgur.com/OfOx9Ta.gif " foldingCube ") | ![ hourGlass] ( https://i.imgur.com/XuOZMuo.gif " hourGlass ") | ![ pianoWave] ( https://i.imgur.com/4omcY6m.gif " pianoWave ") |
120
+
121
+ | pouringHourGlass | pulse | pulsingGrid |
122
+ | ----------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------- |
123
+ | ![ pouringHourGlass] ( https://i.imgur.com/qaDYkEk.gif " pouringHourGlass ") | ![ pulse] ( https://i.imgur.com/XviSAH5.gif " pulse ") | ![ pulsingGrid] ( https://i.imgur.com/XkvLuSm.gif " pulsingGrid ") |
124
+
125
+ | pumpingHeart | ring | ripple |
126
+ | --------------------------------------------------------------- | ----------------------------------------------- | --------------------------------------------------- |
127
+ | ![ pumpingHeart] ( https://i.imgur.com/J6jG4pT.gif " pumpingHeart ") | ![ ring] ( https://i.imgur.com/nDKRcu9.gif " ring ") | ![ ripple] ( https://i.imgur.com/Cdz31l9.gif " ripple ") |
128
+
129
+ | rotatingCircle | rotatingPlain | spinningCircle |
130
+ | ------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------- |
131
+ | ![ rotatingCircle] ( https://i.imgur.com/HFmZVvd.gif " rotatingCircle ") | ![ rotatingPlain] ( https://i.imgur.com/ZRw7ZAk.gif " rotatingPlain ") | ![ spinningCircle] ( https://i.imgur.com/7EvBfP4.gif " spinningCircle ") |
132
+
133
+ | spinningLines | squareCircle | threeBounce |
134
+ | ----------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------- |
135
+ | ![ spinningLines] ( https://i.imgur.com/bZdiHNM.gif " spinningLines ") | ![ squareCircle] ( https://i.imgur.com/OBJsoEO.gif " squareCircle ") | ![ threeBounce] ( https://i.imgur.com/suMlo79.gif " threeBounce ") |
136
+
137
+ | threeInOut | wanderingCubes | waveStart |
138
+ | ----------------------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------- |
139
+ | ![ threeInOut] ( https://i.imgur.com/Vz4QCWh.gif " threeInOut ") | ![ wanderingCubes] ( https://i.imgur.com/S7W2jHT.gif " wanderingCubes ") | ![ waveStart] ( https://i.imgur.com/Tnlsbdo.gif " waveStart ") |
140
+
141
+ | waveCenter | waveEnd | waveSpinner |
142
+ | ----------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------- |
143
+ | ![ waveCenter] ( https://i.imgur.com/MX7SHbN.gif " waveCenter ") | ![ waveEnd] ( https://i.imgur.com/BMLUprM.gif " waveEnd ") | ![ waveSpinner] ( https://i.imgur.com/9geWUc6.gif " waveSpinner ") |
144
+
95
145
## Issues / Features
96
146
97
147
Found a bug or want a new feature? Open an issue in the [ Github repository] ( https://github.com/esentis/load_switch/issues/new/choose ) of the project.
0 commit comments