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 'dart:core'; | |
import 'dart:async'; | |
//I don't really need this, but from an analytics perspective it'd be good to know how long of breaks they're taking | |
// TODO(mike): I probably need to ignore time before start | |
class PausableTimer { | |
final Stopwatch _stopwatch; | |
final Duration maxRunningTime; | |
final void Function(Duration) onTick; |
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
// DO NOT REMOVE: DartPad needs these to run flutter_hooks! | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'dart:async'; | |
// These are needed by the example | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
class UseAnimationControllerExample extends HookWidget { |
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/foundation.dart'; | |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'dart:async'; | |
// Actually needed by the example, but lifted to this file. | |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
// import 'package:flutter_hooks/flutter_hooks.dart'; | |
T useAnimation<T>(Animation<T> animation) { |
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/foundation.dart'; | |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'dart:async'; | |
T useAnimation<T>(Animation<T> animation) { | |
useListenable(animation); | |
return animation.value; | |
} |
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/foundation.dart'; | |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'dart:async'; | |
T useAnimation<T>(Animation<T> animation) { | |
useListenable(animation); |