Skip to content

Commit e49ecf1

Browse files
committed
Animation loop added
1 parent 1412fcc commit e49ecf1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/vinyl/vinyl.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,23 @@ class _TransformAppState extends State<TransformApp>
233233

234234
animParentController = AnimationController(
235235
vsync: this, duration: const Duration(milliseconds: 300));
236+
236237
// Add a status listener
237238
animController.addStatusListener((status) {
238239
if (status == AnimationStatus.completed) {
239-
// Trigger your function here
240+
animParentController.forward();
241+
}
242+
});
243+
244+
animParentController.addStatusListener((status) {
245+
if (status == AnimationStatus.completed) {
240246
print("animation completed | resetting now");
241247
resetAnimation();
242248
_changeAnimationListOrder();
243-
animParentController.forward();
249+
animController.forward();
244250
}
245251
});
252+
246253
// Combine vertical animations on the first Vinyl!
247254
_combinedVerticalAnimation = TweenSequence<double>([
248255
TweenSequenceItem(

0 commit comments

Comments
 (0)