Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • android/org.benoitharrault.puzzlegame
1 result
Show changes
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/cubit/settings_game_cubit.dart';
import 'package:puzzlegame/cubit/settings_global_cubit.dart';
import 'package:puzzlegame/ui/helpers/styled_button.dart';
class StartNewGameButton extends StatelessWidget {
const StartNewGameButton({super.key});
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/ui/helpers/styled_button.dart';
class ResumeSavedGameButton extends StatelessWidget {
const ResumeSavedGameButton({super.key});
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/models/game/game.dart';
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/models/game/moving_tile.dart';
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/models/game/game.dart';
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/models/game/game.dart';
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/config/menu.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/cubit/nav_cubit.dart';
import 'package:puzzlegame/models/game/game.dart';
import 'package:puzzlegame/ui/helpers/app_titles.dart';
import 'package:puzzlegame/ui/helpers/styled_button.dart';
class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget {
const GlobalAppBar({super.key});
......@@ -38,7 +36,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget {
// go to Settings page
menuActions.add(ElevatedButton(
onPressed: () {
context.read<NavCubit>().goToSettingsPage();
BlocProvider.of<NavCubit>(context).goToSettingsPage();
},
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
......@@ -49,7 +47,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget {
// go to About page
menuActions.add(ElevatedButton(
onPressed: () {
context.read<NavCubit>().goToAboutPage();
BlocProvider.of<NavCubit>(context).goToAboutPage();
},
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
......@@ -60,7 +58,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget {
// back to Home page
menuActions.add(ElevatedButton(
onPressed: () {
context.read<NavCubit>().goToGamePage();
BlocProvider.of<NavCubit>(context).goToGamePage();
},
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:puzzlegame/cubit/game_cubit.dart';
import 'package:puzzlegame/ui/helpers/outlined_text_widget.dart';
import 'package:puzzlegame/utils/color_extensions.dart';
class ScoreIndicator extends StatelessWidget {
const ScoreIndicator({super.key});
......
import 'dart:ui';
extension ColorExtension on Color {
Color darken([int percent = 40]) {
assert(1 <= percent && percent <= 100);
final value = 1 - percent / 100;
return Color.fromARGB(
alpha,
(red * value).round(),
(green * value).round(),
(blue * value).round(),
);
}
Color lighten([int percent = 40]) {
assert(1 <= percent && percent <= 100);
final value = percent / 100;
return Color.fromARGB(
alpha,
(red + ((255 - red) * value)).round(),
(green + ((255 - green) * value)).round(),
(blue + ((255 - blue) * value)).round(),
);
}
Color avg(Color other) {
final red = (this.red + other.red) ~/ 2;
final green = (this.green + other.green) ~/ 2;
final blue = (this.blue + other.blue) ~/ 2;
final alpha = (this.alpha + other.alpha) ~/ 2;
return Color.fromARGB(alpha, red, green, blue);
}
}
import 'package:flutter/foundation.dart';
void printlog(String message) {
if (!kReleaseMode) {
debugPrint(message);
}
}
......@@ -13,20 +13,20 @@ packages:
dependency: transitive
description:
name: args
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.dev"
source: hosted
version: "2.5.0"
version: "2.6.0"
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.11.0"
version: "2.12.0"
auto_size_text:
dependency: "direct main"
dependency: transitive
description:
name: auto_size_text
sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599"
......@@ -69,12 +69,12 @@ packages:
dependency: transitive
description:
name: crypto
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.6"
easy_localization:
dependency: "direct main"
dependency: transitive
description:
name: easy_localization
sha256: fa59bcdbbb911a764aa6acf96bbb6fa7a5cf8234354fc45ec1a43a0349ef0201
......@@ -90,7 +90,7 @@ packages:
source: hosted
version: "0.0.2"
equatable:
dependency: "direct main"
dependency: transitive
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
......@@ -119,13 +119,22 @@ packages:
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
dependency: transitive
description:
name: flutter_bloc
sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a
url: "https://pub.dev"
source: hosted
version: "8.1.6"
flutter_custom_toolbox:
dependency: "direct main"
description:
path: "."
ref: "0.1.1"
resolved-ref: ba7137ca9edec7e503ed3dbfe7f6ede7e9cfbf4d
url: "https://git.harrault.fr/android/flutter-toolbox.git"
source: git
version: "0.1.1"
flutter_lints:
dependency: "direct dev"
description:
......@@ -145,7 +154,7 @@ packages:
source: sdk
version: "0.0.0"
hive:
dependency: "direct main"
dependency: transitive
description:
name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
......@@ -169,7 +178,7 @@ packages:
source: hosted
version: "4.0.2"
hydrated_bloc:
dependency: "direct main"
dependency: transitive
description:
name: hydrated_bloc
sha256: af35b357739fe41728df10bec03aad422cdc725a1e702e03af9d2a41ea05160c
......@@ -180,10 +189,10 @@ packages:
dependency: "direct main"
description:
name: image
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d
url: "https://pub.dev"
source: hosted
version: "4.2.0"
version: "4.3.0"
intl:
dependency: transitive
description:
......@@ -225,13 +234,13 @@ packages:
source: hosted
version: "1.0.0"
package_info_plus:
dependency: "direct main"
dependency: transitive
description:
name: package_info_plus
sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef"
sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998
url: "https://pub.dev"
source: hosted
version: "8.0.3"
version: "8.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
......@@ -249,7 +258,7 @@ packages:
source: hosted
version: "1.9.0"
path_provider:
dependency: "direct main"
dependency: transitive
description:
name: path_provider
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
......@@ -308,10 +317,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
url: "https://pub.dev"
source: hosted
version: "3.1.5"
version: "3.1.6"
plugin_platform_interface:
dependency: transitive
description:
......@@ -401,10 +410,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
synchronized:
dependency: transitive
description:
......@@ -425,12 +434,12 @@ packages:
dependency: transitive
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.4.0"
unicons:
dependency: "direct main"
dependency: transitive
description:
name: unicons
sha256: f3eab9d87c226415ef857cfd2167e1d12ad81ea1f5783b46cf644224fea4eab7
......@@ -457,10 +466,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: "4d45dc9069dba4619dc0ebd93c7cec5e66d8482cb625a370ac806dcc8165f2ec"
sha256: "2735daae5150e8b1dfeb3eb0544b4d3af0061e9e82cef063adcd583bdae4306a"
url: "https://pub.dev"
source: hosted
version: "5.5.5"
version: "5.7.0"
xdg_directories:
dependency: transitive
description:
......@@ -478,5 +487,5 @@ packages:
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.5.0 <4.0.0"
dart: ">=3.5.3 <4.0.0"
flutter: ">=3.24.0"
......@@ -3,7 +3,7 @@ description: A puzzle game application.
publish_to: "none"
version: 0.2.1+65
version: 0.3.0+66
environment:
sdk: "^3.0.0"
......@@ -13,15 +13,10 @@ dependencies:
sdk: flutter
# base
auto_size_text: ^3.0.0
easy_localization: ^3.0.1
equatable: ^2.0.5
flutter_bloc: ^8.1.1
hive: ^2.2.3
hydrated_bloc: ^9.0.0
package_info_plus: ^8.0.0
path_provider: ^2.0.11
unicons: ^3.0.0
flutter_custom_toolbox:
git:
url: https://git.harrault.fr/android/flutter-toolbox.git
ref: 0.1.1
# specific
image: ^4.1.3
......@@ -35,15 +30,3 @@ flutter:
- assets/images/
- assets/translations/
- assets/ui/
fonts:
- family: Nunito
fonts:
- asset: assets/fonts/Nunito-Bold.ttf
weight: 700
- asset: assets/fonts/Nunito-Medium.ttf
weight: 500
- asset: assets/fonts/Nunito-Regular.ttf
weight: 400
- asset: assets/fonts/Nunito-Light.ttf
weight: 300