diff --git a/android/gradle.properties b/android/gradle.properties index 9ebd19f8aea61eb37ed1b92717dc56b426e5a1b4..456b137c3f8257f3dd51e13db4aa86c601b05182 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.1.17 -app.versionCode=38 +app.versionName=0.1.18 +app.versionCode=39 diff --git a/assets/skins/default_button_mark_mine_off.png b/assets/skins/default_button_mark_mine_off.png index d74e7ea0ca6a648c0ffdcaffcb6177ffc4c03d02..26e9654a2b744fb089d924eb8ad14bffa9f85d30 100644 Binary files a/assets/skins/default_button_mark_mine_off.png and b/assets/skins/default_button_mark_mine_off.png differ diff --git a/assets/skins/default_button_mark_mine_on.png b/assets/skins/default_button_mark_mine_on.png index 05a61d277c45179ebca7e624451c704f3538ae90..fc90ca62d18b045ef850cc50498d964bb6dc1097 100644 Binary files a/assets/skins/default_button_mark_mine_on.png and b/assets/skins/default_button_mark_mine_on.png differ diff --git a/assets/translations/en.json b/assets/translations/en.json index a598046a8ec88733c979127d5ed13aebf0a0f453..e1e319186b59acfb7adcf7d8fcbb0b37dfe7f21c 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -2,7 +2,7 @@ "app_name": "Minehunter", "long_press_to_quit": "Long press to quit game...", - + "bottom_nav_home": "Game", "bottom_nav_settings": "Settings", "bottom_nav_about": "About", diff --git a/fastlane/metadata/android/en-US/changelogs/39.txt b/fastlane/metadata/android/en-US/changelogs/39.txt new file mode 100644 index 0000000000000000000000000000000000000000..c72c2da51f15e9c5e53d5796eeae42887915a1d4 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/39.txt @@ -0,0 +1 @@ +Improve/clean some code. diff --git a/fastlane/metadata/android/fr-FR/changelogs/39.txt b/fastlane/metadata/android/fr-FR/changelogs/39.txt new file mode 100644 index 0000000000000000000000000000000000000000..a485bd50af35e0f299d35a3039fcd5223045a5ca --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/39.txt @@ -0,0 +1 @@ +Améliorations/corrections de code. diff --git a/icons/skins/default/button_mark_mine_off.svg b/icons/skins/default/button_mark_mine_off.svg index 4ce9b642faf90a6577eb6fce6a34929f08052e14..5360d9409946941de1dbd9cd7980bddfa584eca8 100644 --- a/icons/skins/default/button_mark_mine_off.svg +++ b/icons/skins/default/button_mark_mine_off.svg @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> - <switch transform="matrix(-.65646 0 0 .65646 79.689 14.015)" fill="#000000"> - <g fill="#000"> - <path d="m96.4 47.2-37.2-37.1c-1.5-1.5-4-1.5-5.5 0l-9.1 9.1c-1.5 1.5-1.5 4 0 5.5l14.9 14.9h-53c-2.2 0-3.9 1.8-3.9 3.9v12.9c0 2.2 1.8 3.9 3.9 3.9h53l-15 15c-1.5 1.5-1.5 4 0 5.5l9.1 9.1c1.5 1.5 4 1.5 5.5 0l37.1-37.1c1.7-1.6 1.7-4 0.2-5.6z" fill="#000"/> + <switch transform="matrix(-.65646 0 0 .65646 79.689 14.015)" fill="#808080"> + <g fill="#808080"> + <path d="m96.4 47.2-37.2-37.1c-1.5-1.5-4-1.5-5.5 0l-9.1 9.1c-1.5 1.5-1.5 4 0 5.5l14.9 14.9h-53c-2.2 0-3.9 1.8-3.9 3.9v12.9c0 2.2 1.8 3.9 3.9 3.9h53l-15 15c-1.5 1.5-1.5 4 0 5.5l9.1 9.1c1.5 1.5 4 1.5 5.5 0l37.1-37.1c1.7-1.6 1.7-4 0.2-5.6z" fill="#808080"/> </g> </switch> </svg> diff --git a/icons/skins/default/button_mark_mine_on.svg b/icons/skins/default/button_mark_mine_on.svg index 0d0eec920403df707b0f308dc5e8405aae79d381..2424c7e5d5f420a4cbedd610122bd2ff67600f1b 100644 --- a/icons/skins/default/button_mark_mine_on.svg +++ b/icons/skins/default/button_mark_mine_on.svg @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> - <switch transform="matrix(.65646 0 0 .65646 13.976 14.015)" fill="#000000"> - <g fill="#000"> - <path d="m96.4 47.2-37.2-37.1c-1.5-1.5-4-1.5-5.5 0l-9.1 9.1c-1.5 1.5-1.5 4 0 5.5l14.9 14.9h-53c-2.2 0-3.9 1.8-3.9 3.9v12.9c0 2.2 1.8 3.9 3.9 3.9h53l-15 15c-1.5 1.5-1.5 4 0 5.5l9.1 9.1c1.5 1.5 4 1.5 5.5 0l37.1-37.1c1.7-1.6 1.7-4 0.2-5.6z" fill="#000"/> + <switch transform="matrix(.65646 0 0 .65646 13.976 14.015)" fill="#808080"> + <g fill="#808080"> + <path d="m96.4 47.2-37.2-37.1c-1.5-1.5-4-1.5-5.5 0l-9.1 9.1c-1.5 1.5-1.5 4 0 5.5l14.9 14.9h-53c-2.2 0-3.9 1.8-3.9 3.9v12.9c0 2.2 1.8 3.9 3.9 3.9h53l-15 15c-1.5 1.5-1.5 4 0 5.5l9.1 9.1c1.5 1.5 4 1.5 5.5 0l37.1-37.1c1.7-1.6 1.7-4 0.2-5.6z" fill="#808080"/> </g> </switch> </svg> diff --git a/icons/skins/default/indicator_report_off.svg b/icons/skins/default/indicator_report_off.svg index ecea79f5b408e0c30d0da4357f9a7604779b8f22..64fa1a12d757ae01dc226d72a95eec026ce5d9be 100644 --- a/icons/skins/default/indicator_report_off.svg +++ b/icons/skins/default/indicator_report_off.svg @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="-.0013123" y="-.0014381" width="93.668" height="93.679" ry="0" fill="#9f9f9f" stroke="#fff" stroke-width=".24146"/><path d="m63.009 39.288c-4.4337 1.6324-7.8123 2.7951-10.784 6.4707-2.6476 3.2753-6.4707 4.4107-10.784 2.2516v11.768h-2.1568v-29.117c0-0.5961 0.48232-1.0784 1.0784-1.0784s1.0784 0.48232 1.0784 1.0784c2.3949 3.4817 6.5567 4.2526 10.784 4.3136 6.4707 0.09477 10.784 4.3136 10.784 4.3136zm-19.412 14.306v2.1948c2.5444 0.52025 4.3136 1.624 4.3136 2.911 0 1.7861-3.3806 3.2353-7.5489 3.2353-4.1683 0-7.5489-1.4492-7.5489-3.2353 0-1.287 1.7693-2.3907 4.3136-2.911v-2.1947c-3.9177 0.67828-6.4707 2.5781-6.4707 5.1056 0 3.1742 3.9914 5.392 9.7059 5.392 5.7145 0 9.7059-2.2179 9.7059-5.392 0-2.5275-2.5528-4.4273-6.4707-5.1056z" fill="#af0303" stroke="#730202" stroke-linejoin="round" stroke-width=".86919"/></svg> +<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="-.0013123" y="-.0014381" width="93.668" height="93.679" ry="0" fill="#9f9f9f" stroke="#fff" stroke-width=".24146"/><path d="m63.009 39.288c-4.4337 1.6324-7.8123 2.7951-10.784 6.4707-2.6476 3.2753-6.4707 4.4107-10.784 2.2516v11.768h-2.1568v-29.117c0-0.5961 0.48232-1.0784 1.0784-1.0784s1.0784 0.48232 1.0784 1.0784c2.3949 3.4817 6.5567 4.2526 10.784 4.3136 6.4707 0.09477 10.784 4.3136 10.784 4.3136zm-19.412 14.306v2.1948c2.5444 0.52025 4.3136 1.624 4.3136 2.911 0 1.7861-3.3806 3.2353-7.5489 3.2353s-7.5489-1.4492-7.5489-3.2353c0-1.287 1.7693-2.3907 4.3136-2.911v-2.1947c-3.9177 0.67828-6.4707 2.5781-6.4707 5.1056 0 3.1742 3.9914 5.392 9.7059 5.392s9.7059-2.2179 9.7059-5.392c0-2.5275-2.5528-4.4273-6.4707-5.1056z" fill="#af0303" stroke="#730202" stroke-linejoin="round" stroke-width=".86919"/></svg> diff --git a/icons/skins/default/indicator_report_on.svg b/icons/skins/default/indicator_report_on.svg index b9c0581b57760058d33d613ae4550985521d3d00..a72968f26b03ac74be2cb95d67612ba5f4c5bb04 100644 --- a/icons/skins/default/indicator_report_on.svg +++ b/icons/skins/default/indicator_report_on.svg @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="-.0013123" y="-.0014381" width="93.668" height="93.679" ry="0" fill="#ea9c1f" stroke="#fff" stroke-width=".24146"/><path d="m78.682 31.974c-8.7296 3.214-15.381 5.5032-21.232 12.74-5.2129 6.4487-12.74 8.6842-21.232 4.4332v23.169h-4.2465v-57.328c0-1.1736 0.94963-2.1232 2.1232-2.1232 1.1735 0 2.1232 0.94963 2.1232 2.1232 4.7153 6.855 12.91 8.3728 21.232 8.4931 12.74 0.18659 21.232 8.4931 21.232 8.4931zm-38.22 28.168v4.3213c5.0096 1.0243 8.4931 3.1974 8.4931 5.7314 0 3.5167-6.656 6.3699-14.863 6.3699-8.207 0-14.863-2.8532-14.863-6.3699 0-2.534 3.4834-4.707 8.4931-5.7314v-4.3211c-7.7135 1.3355-12.74 5.076-12.74 10.052 0 6.2497 7.8586 10.616 19.11 10.616s19.11-4.3668 19.11-10.616c0-4.9764-5.0262-8.7168-12.74-10.052z" fill="#af0303" stroke="#730202" stroke-linejoin="round" stroke-width="1.7113"/></svg> +<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="-.0013123" y="-.0014381" width="93.668" height="93.679" ry="0" fill="#ea9c1f" stroke="#fff" stroke-width=".24146"/><path d="m78.682 31.974c-8.7296 3.214-15.381 5.5032-21.232 12.74-5.2129 6.4487-12.74 8.6842-21.232 4.4332v23.169h-4.2465v-57.328c0-1.1736 0.94963-2.1232 2.1232-2.1232 1.1735 0 2.1232 0.94963 2.1232 2.1232 4.7153 6.855 12.91 8.3728 21.232 8.4931 12.74 0.18659 21.232 8.4931 21.232 8.4931zm-38.22 28.168v4.3213c5.0096 1.0243 8.4931 3.1974 8.4931 5.7314 0 3.5167-6.656 6.3699-14.863 6.3699s-14.863-2.8532-14.863-6.3699c0-2.534 3.4834-4.707 8.4931-5.7314v-4.3211c-7.7135 1.3355-12.74 5.076-12.74 10.052 0 6.2497 7.8586 10.616 19.11 10.616s19.11-4.3668 19.11-10.616c0-4.9764-5.0262-8.7168-12.74-10.052z" fill="#af0303" stroke="#730202" stroke-linejoin="round" stroke-width="1.7113"/></svg> diff --git a/lib/config/menu.dart b/lib/config/menu.dart index 689ccfa302de7d5d9eaa7eedbd3f62e1e5776989..09df83be163fa0d2f965c982b46749e27060e8fe 100644 --- a/lib/config/menu.dart +++ b/lib/config/menu.dart @@ -1,5 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; + import 'package:minehunter/ui/screens/about_page.dart'; import 'package:minehunter/ui/screens/game_page.dart'; import 'package:minehunter/ui/screens/settings_page.dart'; diff --git a/lib/cubit/bottom_nav_cubit.dart b/lib/cubit/bottom_nav_cubit.dart index 54261399606dd4f345ef4c753fedef10fc2b1f18..487ffb2870c6bdcc8df87afbe7059837f25fa2ca 100644 --- a/lib/cubit/bottom_nav_cubit.dart +++ b/lib/cubit/bottom_nav_cubit.dart @@ -1,4 +1,5 @@ import 'package:hydrated_bloc/hydrated_bloc.dart'; + import 'package:minehunter/config/menu.dart'; class BottomNavCubit extends HydratedCubit<int> { diff --git a/lib/entities/cell.dart b/lib/entities/cell.dart index ff05ad891d83af959e8afd498a0d5457eabf4a8a..a70bd021e8aabb1e925c180f40e23930518992df 100644 --- a/lib/entities/cell.dart +++ b/lib/entities/cell.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:minehunter/provider/data.dart'; import 'package:minehunter/utils/board_animate.dart'; import 'package:minehunter/utils/board_utils.dart'; diff --git a/lib/main.dart b/lib/main.dart index 15ee02989e0c11b9604421e91764241a28edf641..4041938d48f8821a6d53782495aa920110e86e99 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -50,32 +50,33 @@ class MyApp extends StatelessWidget { BlocProvider<ThemeCubit>(create: (context) => ThemeCubit()), ], child: BlocBuilder<ThemeCubit, ThemeModeState>( - builder: (BuildContext context, ThemeModeState state) { - return ChangeNotifierProvider( - create: (BuildContext context) => Data(), - child: Consumer<Data>( - builder: (context, data, child) { - return OverlaySupport( - child: MaterialApp( - title: 'Minehunter', - home: const SkeletonScreen(), + builder: (BuildContext context, ThemeModeState state) { + return ChangeNotifierProvider( + create: (BuildContext context) => Data(), + child: Consumer<Data>( + builder: (context, data, child) { + return OverlaySupport( + child: MaterialApp( + title: 'Minehunter', + home: const SkeletonScreen(), - // Theme stuff - theme: lightTheme, - darkTheme: darkTheme, - themeMode: state.themeMode, + // Theme stuff + theme: lightTheme, + darkTheme: darkTheme, + themeMode: state.themeMode, - // Localization stuff - localizationsDelegates: context.localizationDelegates, - supportedLocales: context.supportedLocales, - locale: context.locale, - debugShowCheckedModeBanner: false, - ), - ); - }, - ), - ); - }), + // Localization stuff + localizationsDelegates: context.localizationDelegates, + supportedLocales: context.supportedLocales, + locale: context.locale, + debugShowCheckedModeBanner: false, + ), + ); + }, + ), + ); + }, + ), ); } } diff --git a/lib/provider/data.dart b/lib/provider/data.dart index c37658a4d8ada37c3d0d216ed3aeb8cd32ca7f16..0ab77100d03abc731f0b42d95f90ddace2436c3d 100644 --- a/lib/provider/data.dart +++ b/lib/provider/data.dart @@ -1,9 +1,10 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; -import 'package:minehunter/entities/cell.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:minehunter/entities/cell.dart'; + typedef Board = List<List<Cell>>; typedef AnimatedBoard = List<List<bool>>; typedef AnimatedBoardSequence = List<AnimatedBoard>; diff --git a/lib/ui/widgets/game/mode_indicator_report.dart b/lib/ui/widgets/game/mode_indicator_report.dart index aac8757d3e808c3a8e98d0d9a561ffcb3f2e06d0..6387149c844be9c5e056aa06ad143ca820082866 100644 --- a/lib/ui/widgets/game/mode_indicator_report.dart +++ b/lib/ui/widgets/game/mode_indicator_report.dart @@ -9,7 +9,7 @@ class GameModeIndicatorReport extends StatelessWidget { @override Widget build(BuildContext context) { - final String reportModeSuffix = myProvider.reportMode ? 'on' : 'off'; + final String reportModeSuffix = myProvider.reportMode ? 'on' : 'off'; return TextButton( child: Image( diff --git a/lib/ui/widgets/settings/theme_card.dart b/lib/ui/widgets/settings/theme_card.dart index f90b335498779f51326e4bc0e12552be4f3c325d..964e0a9f1d885c9ff255baad7aba3995161a098c 100644 --- a/lib/ui/widgets/settings/theme_card.dart +++ b/lib/ui/widgets/settings/theme_card.dart @@ -16,30 +16,32 @@ class ThemeCard extends StatelessWidget { @override Widget build(BuildContext context) { return BlocBuilder<ThemeCubit, ThemeModeState>( - builder: (BuildContext context, ThemeModeState state) { - return Card( - elevation: 2, - shadowColor: Theme.of(context).colorScheme.shadow, - color: state.themeMode == mode - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.surface, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(12)), - ), - margin: const EdgeInsets.all(5), - child: InkWell( - onTap: () => BlocProvider.of<ThemeCubit>(context).getTheme( - ThemeModeState(themeMode: mode), + builder: (BuildContext context, ThemeModeState state) { + return Card( + elevation: 2, + shadowColor: Theme.of(context).colorScheme.shadow, + color: state.themeMode == mode + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.surface, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(12)), ), - borderRadius: const BorderRadius.all(Radius.circular(12)), - child: Icon( - icon, - size: 32, - color: - state.themeMode != mode ? Theme.of(context).colorScheme.primary : Colors.white, + margin: const EdgeInsets.all(5), + child: InkWell( + onTap: () => BlocProvider.of<ThemeCubit>(context).getTheme( + ThemeModeState(themeMode: mode), + ), + borderRadius: const BorderRadius.all(Radius.circular(12)), + child: Icon( + icon, + size: 32, + color: state.themeMode != mode + ? Theme.of(context).colorScheme.primary + : Colors.white, + ), ), - ), - ); - }); + ); + }, + ); } } diff --git a/lib/utils/game_utils.dart b/lib/utils/game_utils.dart index 383a287ce97a37702e808ecc9412a8da134e3b95..c173564b8f2348763847dfa7d0bf9faabdccec89 100644 --- a/lib/utils/game_utils.dart +++ b/lib/utils/game_utils.dart @@ -4,7 +4,7 @@ import 'package:minehunter/utils/board_utils.dart'; import 'package:minehunter/utils/tools.dart'; class GameUtils { - static Future<void> quitGame(Data myProvider) async { + static quitGame(Data myProvider) { myProvider.updateGameIsRunning(false); if (BoardUtils.checkGameIsFinished(myProvider)) { myProvider.resetCurrentSavedState(); diff --git a/pubspec.yaml b/pubspec.yaml index 72d953f7bb217acdb47a62d5ecd83fb9aa33a945..389e3a375a1109c0a875b5a3961980ca74a89dfc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: minehunter description: A minehunter game application. publish_to: 'none' -version: 0.1.17+38 +version: 0.1.18+39 environment: sdk: '^3.0.0'