Advertisement
Guest User

countdown timer

a guest
May 19th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.42 KB | None | 0 0
  1. AnimationController controller;
  2.  
  3.   String get timerString {
  4.     Duration duration = controller.duration * controller.value;
  5.     return '${(duration.inMinutes % 60).toString().padLeft(2, '0')}:${(duration.inSeconds % 60).toString().padLeft(2, '0')}';
  6.   }
  7.  
  8.   @override
  9.   void initState() {
  10.     super.initState();
  11.     controller = AnimationController(
  12.       vsync: this,
  13.       duration: Duration(seconds: 3),
  14.  
  15.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement