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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user