1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-20 05:57:33 +00:00

More state cleanup

This commit is contained in:
Kevin Moore
2019-05-25 16:22:29 -07:00
parent 62ffd22505
commit cb5036305e
10 changed files with 134 additions and 107 deletions

View File

@@ -2,27 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'core/puzzle_animator.dart';
import 'flutter.dart';
import 'package:flutter_web/foundation.dart';
import 'core/puzzle_proxy.dart';
abstract class AppState {
PuzzleProxy get puzzle;
bool get autoPlay;
void setAutoPlay(bool newValue);
Listenable get animationNotifier;
void clickOrShake(int tileValue) {
setAutoPlay(false);
puzzle.clickOrShake(tileValue);
}
void Function(bool newValue) get setAutoPlayFunction {
if (puzzle.solved) {
return null;
}
return setAutoPlay;
}
}