mine sweeper pt2

This commit is contained in:
2025-10-17 08:24:23 +02:00
parent d51603ff5d
commit 540e13dfe0
2 changed files with 28 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ class MineTile extends StatelessWidget {
child: Text(
'${square.bombsAround}',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: _getTileColor(square.bombsAround, context),
),

View File

@@ -35,7 +35,23 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
int squaresLeft = -1;
bool _isFirstLoad = true;
String getModeConfig() {
switch (modeController.text) {
case ("Easy"):
return "Columns: 10\nRows: 10\nBomds: 15";
case ("Normal"):
return "Columns: 10\nRows: 15\nBomds: 23";
case ("Hard"):
return "Columns: 10\nRows: 20\nBomds: 30";
default:
return "Error";
}
}
void showStartGameWindow(MihMineSweeperProvider mihMineSweeperProvider) {
// easy - 10 * 10 & 15 bombs
// Normal - 10 * 15 & 23 bombs
// Hard - 10 * 20 & 30 bombs
showDialog(
context: context,
builder: (context) {
@@ -58,6 +74,17 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
editable: true,
enableSearch: false,
),
const SizedBox(height: 10),
Text(
getModeConfig(),
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 25),
Center(
child: MihButton(