Migration to mih_package_toolkit
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildMinesweeperLeaderboardList extends StatefulWidget {
|
||||
@@ -21,17 +19,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
Color getMedalColor(int index) {
|
||||
switch (index) {
|
||||
case (0):
|
||||
return MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.gold();
|
||||
case (1):
|
||||
return MihColors.getSilverColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.silver();
|
||||
case (2):
|
||||
return MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.bronze();
|
||||
default:
|
||||
return MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.secondary();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +38,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: mineSweeperProvider.leaderboard!.length,
|
||||
@@ -84,21 +77,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
? Icon(
|
||||
MihIcons.mihRing,
|
||||
size: 80,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: imageFile == null
|
||||
? Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 80,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: MihCircleAvatar(
|
||||
key: UniqueKey(),
|
||||
@@ -109,11 +94,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
frameColor: getMedalColor(index),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
onChange: () {},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildMyScoreBoardList extends StatefulWidget {
|
||||
@@ -18,17 +17,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
Color getMedalColor(int index) {
|
||||
switch (index) {
|
||||
case (0):
|
||||
return MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.gold();
|
||||
case (1):
|
||||
return MihColors.getSilverColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.silver();
|
||||
case (2):
|
||||
return MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.bronze();
|
||||
default:
|
||||
return MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.secondary();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +36,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: mineSweeperProvider.myScoreboard!.length,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
|
||||
class LeaderboardUserRanking extends StatelessWidget {
|
||||
@@ -54,10 +53,8 @@ class LeaderboardUserRanking extends StatelessWidget {
|
||||
editable: false,
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
frameColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
frameColor: MihColors.secondary(),
|
||||
backgroundColor: MihColors.primary(),
|
||||
onChange: () {},
|
||||
),
|
||||
],
|
||||
@@ -67,16 +64,14 @@ class LeaderboardUserRanking extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
).redacted(context: context, redact: isLoading),
|
||||
subtitle: Text(
|
||||
"Score: $gameScore\nTime: $gameTime",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
).redacted(context: context, redact: isLoading),
|
||||
);
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MihMineSweeperStartGameWindow extends StatefulWidget {
|
||||
@@ -132,9 +127,7 @@ class _MihMineSweeperStartGameWindowState
|
||||
Text(
|
||||
getModeConfig(),
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -147,16 +140,12 @@ class _MihMineSweeperStartGameWindowState
|
||||
context.pop();
|
||||
widget.onPressed?.call();
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Start Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/board_square.dart';
|
||||
|
||||
class MineTile extends StatelessWidget {
|
||||
@@ -21,9 +19,7 @@ class MineTile extends StatelessWidget {
|
||||
if (square.isFlagged) {
|
||||
return Icon(
|
||||
Icons.flag,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
),
|
||||
color: MihColors.red(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,33 +52,23 @@ class MineTile extends StatelessWidget {
|
||||
// Choose colors based on standard Minesweeper appearance
|
||||
switch (bombsAround) {
|
||||
case 1:
|
||||
return MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.bluishPurple();
|
||||
// return Colors.blue;
|
||||
case 2:
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
// return Colors.green;
|
||||
case 3:
|
||||
return MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.red();
|
||||
// return Colors.red;
|
||||
case 4:
|
||||
return MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.purple();
|
||||
// return Colors.purple;
|
||||
case 5:
|
||||
return MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.orange();
|
||||
// return Colors.brown;
|
||||
default:
|
||||
// return MihColors.getBluishPurpleColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
// return MihColors.bluishPurple(
|
||||
// ,
|
||||
// );
|
||||
return Colors.black;
|
||||
}
|
||||
@@ -95,13 +81,7 @@ class MineTile extends StatelessWidget {
|
||||
child: MihButton(
|
||||
onPressed: onTap,
|
||||
onLongPressed: onLongPress,
|
||||
buttonColor: square.isOpened
|
||||
? MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
)
|
||||
: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
buttonColor: square.isOpened ? MihColors.grey() : MihColors.secondary(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 3,
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_banner_ad_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
@@ -70,11 +67,11 @@ class _MihMineSweeperState extends State<MihMineSweeper> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appToolTitles: getToolTitle(),
|
||||
appBody: getToolBody(),
|
||||
selectedbodyIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
packageToolBodies: getToolBody(),
|
||||
selectedBodyIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<MihMineSweeperProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
@@ -116,7 +113,7 @@ class _MihMineSweeperState extends State<MihMineSweeper> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MihMineSweeperTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -25,16 +22,14 @@ class _MihMineSweeperTileState extends State<MihMineSweeperTile> {
|
||||
"mihMinesweeper",
|
||||
);
|
||||
},
|
||||
appName: "Minesweeper",
|
||||
appIcon: Icon(
|
||||
packageName: "Minesweeper",
|
||||
packageIcon: Icon(
|
||||
MihIcons.mineSweeper,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/builders/build_minesweeper_leaderboard_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_minesweeper_services.dart';
|
||||
@@ -74,6 +69,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
refreshLeaderBoard(mineSweeperProvider, filterController.text);
|
||||
},
|
||||
child: MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
),
|
||||
@@ -136,9 +132,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -148,9 +142,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -161,11 +153,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -174,11 +162,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
child: Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " and start a new game"),
|
||||
|
||||
@@ -6,18 +6,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/board_square.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/mih_mine_sweeper_start_game_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/mine_tile.dart';
|
||||
@@ -317,21 +309,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
String mode = mihMineSweeperProvider.difficulty;
|
||||
switch (mode) {
|
||||
case "Very Easy":
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
case "Easy":
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
case "Intermediate":
|
||||
return MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.orange();
|
||||
case "Hard":
|
||||
return MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.red();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -346,15 +330,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
fullscreen: false,
|
||||
windowTitle: null,
|
||||
onWindowTapClose: null,
|
||||
backgroundColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
backgroundColor: MihColors.red(),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 125,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -362,8 +344,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Better Luck Next Time",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -374,8 +355,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Your lost this game of MIH Minesweeper!!!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -387,8 +367,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -404,15 +383,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"New Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -422,15 +398,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"View Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -441,15 +414,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
mihMineSweeperProvider.setToolIndex(1);
|
||||
},
|
||||
buttonColor: MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.gold(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Leader Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -473,15 +443,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
fullscreen: false,
|
||||
windowTitle: null,
|
||||
onWindowTapClose: null,
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.green(),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Icon(
|
||||
Icons.celebration,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: 150,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -489,8 +457,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Congratulations",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -501,8 +468,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -510,8 +476,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Time Taken: ${_formatTime().replaceAll("00:", "")}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -519,8 +484,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Score: ${calculateGameScore(mihMineSweeperProvider)}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -536,15 +500,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"New Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -554,15 +515,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"View Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -574,15 +532,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
mihMineSweeperProvider.setToolIndex(1);
|
||||
},
|
||||
buttonColor: MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.gold(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Leader Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -612,6 +567,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
@@ -642,11 +598,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -656,11 +608,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -671,11 +619,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -685,11 +629,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
child: Icon(
|
||||
Icons.menu,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
@@ -803,23 +743,15 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.rule_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Learn how to play",
|
||||
labelBackgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
labelBackgroundColor: MihColors.green(),
|
||||
labelStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.green(),
|
||||
onTap: () {
|
||||
mihMineSweeperProvider.setToolIndex(3);
|
||||
},
|
||||
@@ -827,23 +759,15 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Start New Game",
|
||||
labelBackgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
labelBackgroundColor: MihColors.green(),
|
||||
labelStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.green(),
|
||||
onTap: () {
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MineSweeperQuickStartGuide extends StatefulWidget {
|
||||
const MineSweeperQuickStartGuide({super.key});
|
||||
@@ -21,8 +18,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionOne() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -36,8 +32,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -48,9 +43,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'Quick Tap (or Click): This is the Dig action.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -69,9 +62,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -79,9 +70,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' To uncover a square and see a number clue.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -102,9 +91,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Risk:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -112,9 +99,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' If you click a mine, the game ends!',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -133,9 +118,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'Tap and Hold (or Long Press): This is the Flag action (🚩).',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -154,9 +137,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -164,9 +145,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' To safely mark a square that you are',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -174,9 +153,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' certain',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -184,9 +161,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' is a mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -207,9 +182,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Risk:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -218,9 +191,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Accidental placement of flags will cause confusion.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -241,9 +212,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Benefit:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -252,9 +221,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' You cannot accidentally click a square that is flagged.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -273,8 +240,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionTwo() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -288,8 +254,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -301,9 +266,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'The number tells you exactly how many mines are touching that square (including sides and corners).',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -322,9 +285,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a Blank Space (a '0'):",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -332,9 +293,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: " Zero (0) ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -343,9 +302,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' mines are touching it. All surrounding squares are safe, and the game will open them for you automatically.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -366,9 +323,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a '1':",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -376,9 +331,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Only ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -386,9 +339,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'one',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -397,9 +348,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' mine is touching this square. You must find and flag that single mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -420,9 +369,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a '3':",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -430,9 +377,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: " Three ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -441,9 +386,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'mines are touching this square. You must find and flag all three.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -462,8 +405,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionThree() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -477,8 +419,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -490,9 +431,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'The game is won by uncovering every single safe square and correctly flagging all the mines. Use this two-step loop to clear the board:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -507,9 +446,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'A. Find the Mines (Where to Flag 🚩)',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.purple(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -528,9 +465,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -539,9 +474,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Look for a number that only has one choice for a mine. e.g. If a \'1\' is touching only one hidden square, that hidden square',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -549,9 +482,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' must ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -559,9 +490,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'be the mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -582,9 +511,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Action:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -592,9 +519,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Tap and Hold to place a',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -602,9 +527,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Flag ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -612,9 +535,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'on the square you are sure is a mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -632,9 +553,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'B. Find the Safe Squares (Where to Dig)',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.purple(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -653,9 +572,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -664,9 +581,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Look for a number that has been \'satisfied\' by your flags. e.g. You see a \'2\' and you have already placed two 🚩 flags touching it. The \'2\' is satisfied.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -687,9 +602,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Action:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -698,9 +611,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Quick Tap any of the remaining hidden squares touching that \'satisfied\' number. They',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -708,9 +619,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' must be safe ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -719,9 +628,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'because the mine requirement has already been met.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -740,8 +647,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionFour() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -755,8 +661,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -770,9 +675,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• Start on the Edges and Corners: ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.bronze(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -781,9 +684,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'Numbers on the edge or corner of the board are easier to solve because they have fewer surrounding squares to check.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -804,9 +705,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• Don't Guess: ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.bronze(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -815,9 +714,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'If you are down to two squares and either one could be the mine, look somewhere else on the board for a guaranteed, safe move.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -838,6 +735,7 @@ class _MineSweeperQuickStartGuideState
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
final double width = size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
);
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/builders/build_my_scoreboard_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_minesweeper_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
@@ -64,6 +59,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
refreshLeaderBoard(mineSweeperProvider, filterController.text);
|
||||
},
|
||||
child: MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
),
|
||||
@@ -91,10 +87,8 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
editable: false,
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
frameColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
frameColor: MihColors.secondary(),
|
||||
backgroundColor: MihColors.primary(),
|
||||
onChange: (selectedImage) {},
|
||||
key: ValueKey(profileProvider.userProfilePicUrl),
|
||||
),
|
||||
@@ -142,9 +136,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -154,9 +146,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -167,11 +157,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -180,11 +166,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
child: Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " and start a new game"),
|
||||
|
||||
Reference in New Issue
Block a user