Skip to content

Instantly share code, notes, and snippets.

View leecommamichael's full-sized avatar
🌲
gnitirW

Michael Lee leecommamichael

🌲
gnitirW
View GitHub Profile
@leecommamichael
leecommamichael / main.dart
Created April 17, 2020 05:23
Stopwatch Example
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;
@leecommamichael
leecommamichael / main.dart
Last active December 1, 2019 23:43
Flipping the order of main and test to see if it works...
// 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 {
@leecommamichael
leecommamichael / main.dart
Last active December 1, 2019 23:35
Attempting to run the example using special names from DartPad
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) {
@leecommamichael
leecommamichael / flutter_hooks.dart
Created December 1, 2019 22:55
Hiding a package in DartPad
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;
}
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);