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

Improve/clean some code

parent ef9096ad
No related branches found
No related tags found
1 merge request!41Resolve "Improve/clean code"
Pipeline #5484 passed
This commit is part of merge request !41. Comments created here will be created in the context of that merge request.
Showing
with 71 additions and 62 deletions
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.1.17 app.versionName=0.1.18
app.versionCode=38 app.versionCode=39
assets/skins/default_button_mark_mine_off.png

1.05 KiB | W: | H:

assets/skins/default_button_mark_mine_off.png

1.05 KiB | W: | H:

assets/skins/default_button_mark_mine_off.png
assets/skins/default_button_mark_mine_off.png
assets/skins/default_button_mark_mine_off.png
assets/skins/default_button_mark_mine_off.png
  • 2-up
  • Swipe
  • Onion skin
assets/skins/default_button_mark_mine_on.png

1.02 KiB | W: | H:

assets/skins/default_button_mark_mine_on.png

1.02 KiB | W: | H:

assets/skins/default_button_mark_mine_on.png
assets/skins/default_button_mark_mine_on.png
assets/skins/default_button_mark_mine_on.png
assets/skins/default_button_mark_mine_on.png
  • 2-up
  • Swipe
  • Onion skin
Improve/clean some code.
Améliorations/corrections de code.
<?xml version="1.0" encoding="UTF-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"> <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"> <switch transform="matrix(-.65646 0 0 .65646 79.689 14.015)" fill="#808080">
<g fill="#000"> <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="#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="#808080"/>
</g> </g>
</switch> </switch>
</svg> </svg>
<?xml version="1.0" encoding="UTF-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"> <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"> <switch transform="matrix(.65646 0 0 .65646 13.976 14.015)" fill="#808080">
<g fill="#000"> <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="#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="#808080"/>
</g> </g>
</switch> </switch>
</svg> </svg>
<?xml version="1.0" encoding="UTF-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"><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>
<?xml version="1.0" encoding="UTF-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"><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>
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:minehunter/ui/screens/about_page.dart'; import 'package:minehunter/ui/screens/about_page.dart';
import 'package:minehunter/ui/screens/game_page.dart'; import 'package:minehunter/ui/screens/game_page.dart';
import 'package:minehunter/ui/screens/settings_page.dart'; import 'package:minehunter/ui/screens/settings_page.dart';
......
import 'package:hydrated_bloc/hydrated_bloc.dart'; import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:minehunter/config/menu.dart'; import 'package:minehunter/config/menu.dart';
class BottomNavCubit extends HydratedCubit<int> { class BottomNavCubit extends HydratedCubit<int> {
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:minehunter/provider/data.dart'; import 'package:minehunter/provider/data.dart';
import 'package:minehunter/utils/board_animate.dart'; import 'package:minehunter/utils/board_animate.dart';
import 'package:minehunter/utils/board_utils.dart'; import 'package:minehunter/utils/board_utils.dart';
......
...@@ -75,7 +75,8 @@ class MyApp extends StatelessWidget { ...@@ -75,7 +75,8 @@ class MyApp extends StatelessWidget {
}, },
), ),
); );
}), },
),
); );
} }
} }
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:minehunter/entities/cell.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:minehunter/entities/cell.dart';
typedef Board = List<List<Cell>>; typedef Board = List<List<Cell>>;
typedef AnimatedBoard = List<List<bool>>; typedef AnimatedBoard = List<List<bool>>;
typedef AnimatedBoardSequence = List<AnimatedBoard>; typedef AnimatedBoardSequence = List<AnimatedBoard>;
......
...@@ -35,11 +35,13 @@ class ThemeCard extends StatelessWidget { ...@@ -35,11 +35,13 @@ class ThemeCard extends StatelessWidget {
child: Icon( child: Icon(
icon, icon,
size: 32, size: 32,
color: color: state.themeMode != mode
state.themeMode != mode ? Theme.of(context).colorScheme.primary : Colors.white, ? Theme.of(context).colorScheme.primary
: Colors.white,
), ),
), ),
); );
}); },
);
} }
} }
...@@ -4,7 +4,7 @@ import 'package:minehunter/utils/board_utils.dart'; ...@@ -4,7 +4,7 @@ import 'package:minehunter/utils/board_utils.dart';
import 'package:minehunter/utils/tools.dart'; import 'package:minehunter/utils/tools.dart';
class GameUtils { class GameUtils {
static Future<void> quitGame(Data myProvider) async { static quitGame(Data myProvider) {
myProvider.updateGameIsRunning(false); myProvider.updateGameIsRunning(false);
if (BoardUtils.checkGameIsFinished(myProvider)) { if (BoardUtils.checkGameIsFinished(myProvider)) {
myProvider.resetCurrentSavedState(); myProvider.resetCurrentSavedState();
......
...@@ -2,7 +2,7 @@ name: minehunter ...@@ -2,7 +2,7 @@ name: minehunter
description: A minehunter game application. description: A minehunter game application.
publish_to: 'none' publish_to: 'none'
version: 0.1.17+38 version: 0.1.18+39
environment: environment:
sdk: '^3.0.0' 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