Created
October 6, 2022 00:33
-
-
Save Hixie/b1b81a1c1bd4afea90c030c4eb3f0286 to your computer and use it in GitHub Desktop.
Playing with animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart' show TestVSync; | |
void main() { | |
runApp(const Placeholder()); // to trigger the scheduler | |
AnimationController test = AnimationController( | |
duration: const Duration(milliseconds: 200), | |
vsync: const TestVSync(), | |
); | |
//Animation<double> animation = test; | |
//Animation<double> animation = ReverseAnimation(test); | |
Animation<double> animation = test.drive(Tween<double>(begin: 1, end: 0)); | |
animation.addListener(() { debugPrint('${animation.status} ${animation.value}'); }); | |
test.forward(); | |
//test.repeat(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment