Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Last active March 23, 2025 14:59
Show Gist options
  • Select an option

  • Save chooyan-eng/6b825290eb85c5a01f8ec85d460c65fe to your computer and use it in GitHub Desktop.

Select an option

Save chooyan-eng/6b825290eb85c5a01f8ec85d460c65fe to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: AnimationPage()));
}
class AnimationPage extends StatefulWidget {
const AnimationPage({super.key});
@override
State<AnimationPage> createState() => _AnimationPageState();
}
class _AnimationPageState extends State<AnimationPage>
with TickerProviderStateMixin {
late final AnimationController controller;
@override
void initState() {
super.initState();
controller = AnimationController(
vsync: this,
duration: Duration(seconds: 1),
)..addListener(() {
// just print the current value
debugPrint(controller.value.toString());
});
controller.forward();
}
@override
Widget build(BuildContext context) {
return Scaffold();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment