Skip to content

Commit 4211f37

Browse files
authored
v5.2.0 (#116)
2 parents bd5827f + 9397db0 commit 4211f37

38 files changed

+151
-142
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ jobs:
2020
- uses: actions/setup-java@v1
2121
with:
2222
java-version: "12.x"
23-
- uses: subosito/flutter-action@v1
23+
- uses: subosito/flutter-action@v2
2424
with:
25-
channel: "dev"
25+
cache: true
26+
channel: 'stable'
27+
- run: flutter doctor
2628
- run: flutter pub get
2729
- run: flutter format --set-exit-if-changed -l 120 lib -l 120 example
2830
- run: flutter analyze lib example
@@ -31,4 +33,4 @@ jobs:
3133
- name: Upload coverage to codecov
3234
uses: codecov/codecov-action@v1
3335
with:
34-
fail_ci_if_error: true
36+
fail_ci_if_error: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit.
44

5+
## 5.2.0
6+
7+
- Fix `SpinKitCircle`, `SpinKitFadingCircle`, `SpinKitDancingSquare` animation
8+
- Fix calling `setState` on unmounted states
9+
- Introduced [SpinKitWaveSpinner]
10+
- Introduced [SpinKitPulsingGrid]
11+
512
## 5.1.0
613

714
- Renamed `SpinKitPouringHourglass` -> `SpinKitPouringHourGlass` for correctness

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A collection of loading indicators animated with flutter. Heavily inspired by [@
88

99
```yaml
1010
dependencies:
11-
flutter_spinkit: ^5.1.0
11+
flutter_spinkit: ^5.2.0
1212
```
1313
1414
### ⚡️ Import

analysis_options.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
include: package:flutter_lints/flutter.yaml
22

33
analyzer:
4-
strong-mode:
5-
implicit-casts: false
6-
implicit-dynamic: false
74
errors:
85
missing_required_param: error
96
missing_return: error
@@ -40,4 +37,5 @@ linter:
4037
- unnecessary_statements
4138
- use_late_for_private_fields_and_variables
4239
- use_named_constants
43-
- use_raw_strings
40+
- use_raw_strings
41+
- use_super_parameters

lib/src/chasing_dots.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SpinKitChasingDots extends StatefulWidget {
1717
final Duration duration;
1818

1919
@override
20-
_SpinKitChasingDotsState createState() => _SpinKitChasingDotsState();
20+
State<SpinKitChasingDots> createState() => _SpinKitChasingDotsState();
2121
}
2222

2323
class _SpinKitChasingDotsState extends State<SpinKitChasingDots> with TickerProviderStateMixin {

lib/src/circle.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ class SpinKitCircle extends StatefulWidget {
2020
final AnimationController? controller;
2121

2222
@override
23-
_SpinKitCircleState createState() => _SpinKitCircleState();
23+
State<SpinKitCircle> createState() => _SpinKitCircleState();
2424
}
2525

2626
class _SpinKitCircleState extends State<SpinKitCircle> with SingleTickerProviderStateMixin {
27-
final List<double> delays = [.0, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1];
27+
static const _itemCount = 12;
28+
2829
late AnimationController _controller;
2930

3031
@override
@@ -48,17 +49,17 @@ class _SpinKitCircleState extends State<SpinKitCircle> with SingleTickerProvider
4849
child: SizedBox.fromSize(
4950
size: Size.square(widget.size),
5051
child: Stack(
51-
children: List.generate(delays.length, (index) {
52-
final _position = widget.size * .5;
52+
children: List.generate(_itemCount, (index) {
53+
final position = widget.size * .5;
5354
return Positioned.fill(
54-
left: _position,
55-
top: _position,
55+
left: position,
56+
top: position,
5657
child: Transform(
5758
transform: Matrix4.rotationZ(30.0 * index * 0.0174533),
5859
child: Align(
5960
alignment: Alignment.center,
6061
child: ScaleTransition(
61-
scale: DelayTween(begin: 0.0, end: 1.0, delay: delays[index]).animate(_controller),
62+
scale: DelayTween(begin: 0.0, end: 1.0, delay: index / _itemCount).animate(_controller),
6263
child: SizedBox.fromSize(size: Size.square(widget.size * 0.15), child: _itemBuilder(index)),
6364
),
6465
),

lib/src/cube_grid.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SpinKitCubeGrid extends StatefulWidget {
1919
final AnimationController? controller;
2020

2121
@override
22-
_SpinKitCubeGridState createState() => _SpinKitCubeGridState();
22+
State<SpinKitCubeGrid> createState() => _SpinKitCubeGridState();
2323
}
2424

2525
class _SpinKitCubeGridState extends State<SpinKitCubeGrid> with SingleTickerProviderStateMixin {

lib/src/dancing_square.dart

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ class SpinKitDancingSquare extends StatefulWidget {
2121
final AnimationController? controller;
2222

2323
@override
24-
_SpinKitDancingSquareState createState() => _SpinKitDancingSquareState();
24+
State<SpinKitDancingSquare> createState() => _SpinKitDancingSquareState();
2525
}
2626

2727
class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with SingleTickerProviderStateMixin {
28-
final List<double> delays = [.0, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1];
28+
static const _itemCount = 12;
29+
2930
late AnimationController _controller;
3031

3132
@override
@@ -49,19 +50,20 @@ class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with Single
4950
child: SizedBox.fromSize(
5051
size: Size.square(widget.size),
5152
child: Stack(
52-
children: List.generate(delays.length, (index) {
53-
final _position = widget.size * .5;
53+
children: List.generate(_itemCount, (index) {
54+
final position = widget.size * .5;
55+
final delay = index / _itemCount;
5456
return Stack(
5557
children: [
5658
Positioned.fill(
57-
left: _position,
58-
top: _position,
59+
left: position,
60+
top: position,
5961
child: Transform(
6062
transform: Matrix4.rotationX(30.0 * index * 0.0174533),
6163
child: Align(
6264
alignment: Alignment.center,
6365
child: ScaleTransition(
64-
scale: DelayTween(begin: 0.0, end: 1.0, delay: delays[index]).animate(_controller),
66+
scale: DelayTween(begin: 0.0, end: 1.0, delay: delay).animate(_controller),
6567
child: SizedBox.fromSize(
6668
size: Size.square(widget.size * 0.15),
6769
child: _itemBuilder(index),
@@ -71,14 +73,14 @@ class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with Single
7173
),
7274
),
7375
Positioned.fill(
74-
left: _position,
75-
top: -1 * _position,
76+
left: position,
77+
top: -1 * position,
7678
child: Transform(
7779
transform: Matrix4.rotationY(30.0 * index * 0.0174533),
7880
child: Align(
7981
alignment: Alignment.center,
8082
child: ScaleTransition(
81-
scale: DelayTween(begin: 0.0, end: 1.0, delay: delays[index]).animate(_controller),
83+
scale: DelayTween(begin: 0.0, end: 1.0, delay: delay).animate(_controller),
8284
child: SizedBox.fromSize(
8385
size: Size.square(widget.size * 0.15),
8486
child: _itemBuilder(index),
@@ -88,14 +90,14 @@ class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with Single
8890
),
8991
),
9092
Positioned.fill(
91-
left: -1 * _position,
92-
top: _position,
93+
left: -1 * position,
94+
top: position,
9395
child: Transform(
9496
transform: Matrix4.rotationX(30.0 * index * 0.0174533),
9597
child: Align(
9698
alignment: Alignment.center,
9799
child: ScaleTransition(
98-
scale: DelayTween(begin: 0.0, end: 1.0, delay: delays[index]).animate(_controller),
100+
scale: DelayTween(begin: 0.0, end: 1.0, delay: delay).animate(_controller),
99101
child: SizedBox.fromSize(
100102
size: Size.square(widget.size * 0.15),
101103
child: _itemBuilder(index),
@@ -105,14 +107,14 @@ class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with Single
105107
),
106108
),
107109
Positioned.fill(
108-
left: _position,
109-
top: _position,
110+
left: position,
111+
top: position,
110112
child: Transform(
111113
transform: Matrix4.rotationY(30.0 * index * 0.0174533),
112114
child: Align(
113115
alignment: Alignment.center,
114116
child: ScaleTransition(
115-
scale: DelayTween(begin: 0.0, end: 1.0, delay: delays[index]).animate(_controller),
117+
scale: DelayTween(begin: 0.0, end: 1.0, delay: delay).animate(_controller),
116118
child: SizedBox.fromSize(
117119
size: Size.square(widget.size * 0.15),
118120
child: _itemBuilder(index),

lib/src/double_bounce.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SpinKitDoubleBounce extends StatefulWidget {
1919
final AnimationController? controller;
2020

2121
@override
22-
_SpinKitDoubleBounceState createState() => _SpinKitDoubleBounceState();
22+
State<SpinKitDoubleBounce> createState() => _SpinKitDoubleBounceState();
2323
}
2424

2525
class _SpinKitDoubleBounceState extends State<SpinKitDoubleBounce> with SingleTickerProviderStateMixin {

lib/src/dual_ring.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SpinKitDualRing extends StatefulWidget {
1919
final AnimationController? controller;
2020

2121
@override
22-
_SpinKitDualRingState createState() => _SpinKitDualRingState();
22+
State<SpinKitDualRing> createState() => _SpinKitDualRingState();
2323
}
2424

2525
class _SpinKitDualRingState extends State<SpinKitDualRing> with SingleTickerProviderStateMixin {
@@ -56,8 +56,8 @@ class _SpinKitDualRingState extends State<SpinKitDualRing> with SingleTickerProv
5656
transform: Matrix4.identity()..rotateZ((_animation.value) * math.pi * 2),
5757
alignment: FractionalOffset.center,
5858
child: CustomPaint(
59-
child: SizedBox.fromSize(size: Size.square(widget.size)),
6059
painter: _DualRingPainter(angle: 90, paintWidth: widget.lineWidth, color: widget.color),
60+
child: SizedBox.fromSize(size: Size.square(widget.size)),
6161
),
6262
),
6363
);

0 commit comments

Comments
 (0)