1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-25 17:06:44 +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,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'app_state.dart';
import 'core/puzzle_proxy.dart';
import 'flutter.dart';
import 'shared_theme.dart';
@@ -33,9 +33,9 @@ class ThemeSimple extends SharedTheme {
);
@override
Widget tileButton(int i, AppState appState, bool small) {
if (i == appState.puzzle.tileCount) {
assert(appState.puzzle.solved);
Widget tileButton(int i, PuzzleProxy puzzle, bool small) {
if (i == puzzle.tileCount) {
assert(puzzle.solved);
return const Center(
child: Icon(
Icons.thumb_up,
@@ -45,7 +45,7 @@ class ThemeSimple extends SharedTheme {
);
}
final correctPosition = appState.puzzle.isCorrectPosition(i);
final correctPosition = puzzle.isCorrectPosition(i);
final content = createInk(
Center(
@@ -61,7 +61,7 @@ class ThemeSimple extends SharedTheme {
);
return createButton(
appState,
puzzle,
small,
i,
content,