diff --git a/android/gradle.properties b/android/gradle.properties index cd2d833ca96b3d1ada4a39df51dc5f5ee67665b7..30298b3b3f04073678e48519b8c043edba635df8 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.17 -app.versionCode=17 +app.versionName=0.0.18 +app.versionCode=18 diff --git a/fastlane/metadata/android/en-US/changelogs/18.txt b/fastlane/metadata/android/en-US/changelogs/18.txt new file mode 100644 index 0000000000000000000000000000000000000000..8998d706adfaf94a487cb95a9c6ce8337b1bba53 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/18.txt @@ -0,0 +1 @@ +Add shuffle colors button. diff --git a/fastlane/metadata/android/fr-FR/changelogs/18.txt b/fastlane/metadata/android/fr-FR/changelogs/18.txt new file mode 100644 index 0000000000000000000000000000000000000000..f333e245ccd83f14e98f2fc284c15f165c27daa6 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/18.txt @@ -0,0 +1 @@ +Ajout d'un bouton pour mélanger les couleurs. diff --git a/lib/cubit/game_cubit.dart b/lib/cubit/game_cubit.dart index cc446d662f6b5a537177d60c4b91eab5651da77d..4bcda5b9930a719134b215118f20fe31432f21b3 100644 --- a/lib/cubit/game_cubit.dart +++ b/lib/cubit/game_cubit.dart @@ -67,6 +67,10 @@ class GameCubit extends HydratedCubit<GameState> { refresh(); } + void shuffleColors() { + this.state.currentGame.shuffleColorsAgain(); + } + moveCellsDown() { final Game currentGame = this.state.currentGame; diff --git a/lib/models/game.dart b/lib/models/game.dart index 94f253860ad7ce29a9e558e14a9378b69fa86e29..423654aa88be4d6e0a10e7a285af9868ee7f71b0 100644 --- a/lib/models/game.dart +++ b/lib/models/game.dart @@ -53,6 +53,10 @@ class Game { return values; } + void shuffleColorsAgain() { + this.shuffledColors = shuffleColors(); + } + GameCell getCell(CellLocation cellLocation) { return this.board.cells[cellLocation.row][cellLocation.col]; } diff --git a/lib/ui/widgets/game_top_indicator.dart b/lib/ui/widgets/game_top_indicator.dart index 298c502d72b5230038b4e03a81617744f27d288a..1e692b3b36a1f49ebcd67b6e969f57d7cfc79bac 100644 --- a/lib/ui/widgets/game_top_indicator.dart +++ b/lib/ui/widgets/game_top_indicator.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:unicons/unicons.dart'; import 'package:jeweled/cubit/game_cubit.dart'; import 'package:jeweled/models/game.dart'; @@ -55,6 +56,13 @@ class GameTopIndicatorWidget extends StatelessWidget { color: availableBlocksCountTextColor, ), ), + TextButton( + child: Icon(UniconsSolid.refresh), + onPressed: () { + final GameCubit gameCubit = BlocProvider.of<GameCubit>(context); + gameCubit.shuffleColors(); + }, + ) ], ), ], diff --git a/pubspec.yaml b/pubspec.yaml index 542bbc66f64c1090829b7e4a5bfb09bec029b0f4..52d05e3352e55724d745512f3a174cbf7fca9962 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Jeweled Game publish_to: 'none' -version: 0.0.17+17 +version: 0.0.18+18 environment: sdk: '^3.0.0'