diff --git a/android/gradle.properties b/android/gradle.properties index 1913fd1742a8e1553517f28698109845b429435c..2552329351d81a9215979cc5aca266e6c6dc80f8 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.0 -app.versionCode=24 +app.versionName=0.1.1 +app.versionCode=25 diff --git a/fastlane/metadata/android/en-US/changelogs/25.txt b/fastlane/metadata/android/en-US/changelogs/25.txt new file mode 100644 index 0000000000000000000000000000000000000000..0b0f90c36966be44bc819702133c9a8eab6b4aec --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/25.txt @@ -0,0 +1 @@ +Display current game moves counter. diff --git a/fastlane/metadata/android/fr-FR/changelogs/25.txt b/fastlane/metadata/android/fr-FR/changelogs/25.txt new file mode 100644 index 0000000000000000000000000000000000000000..055e1c6bb5c9ab7dca95975b275d4ce1e95706bc --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/25.txt @@ -0,0 +1 @@ +Affichage d'un compteur de mouvements de la partie. diff --git a/lib/ui/widgets/game/game_board.dart b/lib/ui/widgets/game/game_board.dart index 0fcdef29991b9fa9811978d0de8a07d134387fa9..f374604a7cac2af659180507901f9856d14516b7 100644 --- a/lib/ui/widgets/game/game_board.dart +++ b/lib/ui/widgets/game/game_board.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:twister/ui/widgets/game/game_current_move.dart'; +import 'package:twister/ui/widgets/game/game_moves_count.dart'; import 'package:twister/ui/widgets/game/game_moves_history.dart'; class GameBoardWidget extends StatelessWidget { @@ -13,6 +14,7 @@ class GameBoardWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ GameCurrentMoveWidget(), + GameMovesCountWidget(), GameMovesHistoryWidget(), ], ); diff --git a/lib/ui/widgets/game/game_moves_count.dart b/lib/ui/widgets/game/game_moves_count.dart new file mode 100644 index 0000000000000000000000000000000000000000..95d1e6576bf92f6c97c871f58c6dda4994a7c970 --- /dev/null +++ b/lib/ui/widgets/game/game_moves_count.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import 'package:twister/cubit/game_cubit.dart'; +import 'package:twister/ui/helpers/outlined_text_widget.dart'; + +class GameMovesCountWidget extends StatelessWidget { + const GameMovesCountWidget({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder<GameCubit, GameState>( + builder: (BuildContext context, GameState gameState) { + return OutlinedText( + text: gameState.currentGame.history.length.toString(), + fontSize: 50, + textColor: Colors.grey, + outlineColor: Colors.grey.shade200, + ); + }, + ); + } +} diff --git a/lib/ui/widgets/game/game_moves_history.dart b/lib/ui/widgets/game/game_moves_history.dart index 67eb3e7a04f4a0e59fcbaad493b100ba9a44d72e..33d0ff00deaaafcd247206e3190c1ec65f021f52 100644 --- a/lib/ui/widgets/game/game_moves_history.dart +++ b/lib/ui/widgets/game/game_moves_history.dart @@ -54,7 +54,10 @@ class GameMovesHistoryWidget extends StatelessWidget { ); return Padding( - padding: const EdgeInsets.all(30), + padding: const EdgeInsets.only( + left: 30, + right: 30, + ), child: Table( children: [ TableRow( diff --git a/pubspec.yaml b/pubspec.yaml index 16ca4fa71f59c870321d1572528a85c75a16b4eb..6626c2e803254c656ce7f0d9c2e9984d3fa83525 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Twister game companion publish_to: "none" -version: 0.1.0+24 +version: 0.1.1+25 environment: sdk: "^3.0.0"