Skip to content

Instantly share code, notes, and snippets.

@Hixie
Created October 6, 2022 00:33
Show Gist options
  • Save Hixie/b1b81a1c1bd4afea90c030c4eb3f0286 to your computer and use it in GitHub Desktop.
Save Hixie/b1b81a1c1bd4afea90c030c4eb3f0286 to your computer and use it in GitHub Desktop.
Playing with animations
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