Skip to content
Snippets Groups Projects
Commit e5a4e7cc authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Add "shuffle colors" button

parent be7903a8
No related branches found
No related tags found
1 merge request!18Resolve "Add shuffle colors button"
Pipeline #4961 passed
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
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
Add shuffle colors button.
Ajout d'un bouton pour mélanger les couleurs.
......@@ -67,6 +67,10 @@ class GameCubit extends HydratedCubit<GameState> {
refresh();
}
void shuffleColors() {
this.state.currentGame.shuffleColorsAgain();
}
moveCellsDown() {
final Game currentGame = this.state.currentGame;
......
......@@ -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];
}
......
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();
},
)
],
),
],
......
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment