Skip to content

Commit

Permalink
fix(shuffle) : fix shuffle button and shuffle puzzle on generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanvandeperre97 committed Feb 21, 2022
1 parent 756f2b0 commit 5da7a86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/models/puzzle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Puzzle {

return Puzzle(
complexity: complexity,
data: data,
data: data..shuffle(),
);
}

Expand Down
6 changes: 4 additions & 2 deletions lib/view/puzzle_page/puzzle_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ class _PuzzlePageState extends State<PuzzlePage> {

/// Shuffle the puzzle.
void _shuffle(BuildContext context) {
context.read<PuzzleCubit>().shuffle();
_puzzleFocusNode.requestFocus();
setState(() {
context.read<PuzzleCubit>().shuffle();
_puzzleFocusNode.requestFocus();
});
}

/// Reset the puzzle.
Expand Down

0 comments on commit 5da7a86

Please sign in to comment.