1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-07 04:02:13 +00:00

slide_puzzle: use pkg:provider

This commit is contained in:
Kevin Moore
2019-05-23 18:05:12 -07:00
parent 051f5bec29
commit 0e50bbd6c9
10 changed files with 206 additions and 214 deletions

View File

@@ -4,28 +4,25 @@
import 'core/puzzle_animator.dart';
import 'flutter.dart';
import 'shared_theme.dart';
abstract class AppState {
TabController get tabController;
PuzzleProxy get puzzle;
bool get autoPlay;
void setAutoPlay(bool newValue);
AnimationNotifier get animationNotifier;
Listenable get animationNotifier;
Iterable<SharedTheme> get themeData;
void clickOrShake(int tileValue) {
setAutoPlay(false);
puzzle.clickOrShake(tileValue);
}
SharedTheme get currentTheme;
set currentTheme(SharedTheme theme);
}
abstract class AnimationNotifier implements Listenable {
void animate();
void dispose();
void Function(bool newValue) get setAutoPlayFunction {
if (puzzle.solved) {
return null;
}
return setAutoPlay;
}
}