From f6fa31196e735d5198c9632fb4c23875e83b9134 Mon Sep 17 00:00:00 2001 From: plush2408 Date: Thu, 13 Jun 2024 12:34:45 +0200 Subject: [PATCH] ++ tests and analyze --- lib/screens/settings.dart | 10 +++++----- pubspec.lock | 2 +- pubspec.yaml | 4 +--- test/{gameboard_test..dart => gameboard_test.dart} | 0 test/playerregistry_test.dart | 6 +++--- 5 files changed, 10 insertions(+), 12 deletions(-) rename test/{gameboard_test..dart => gameboard_test.dart} (100%) diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index d8cd3ca..dc209d5 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -27,7 +27,7 @@ class _GameSettingsState extends State { appBar: AppBar( title: Text( "Werwolf", - style: Theme.of(context).textTheme.titleLarge, // Apply text theme + style: Theme.of(context).textTheme.titleLarge, ), centerTitle: true, ), @@ -37,7 +37,7 @@ class _GameSettingsState extends State { children: [ Text( "Anzahl der Spieler ${widget.playernames.length}", - style: Theme.of(context).textTheme.titleLarge, // Apply text theme + style: Theme.of(context).textTheme.titleLarge, ), const Divider( height: 60, @@ -49,7 +49,7 @@ class _GameSettingsState extends State { Text( "Anzahl der Werwölfe ${game.getWolves()}", style: - Theme.of(context).textTheme.bodyLarge, // Apply text theme + Theme.of(context).textTheme.bodyLarge, ), IconButton( onPressed: () { @@ -77,7 +77,7 @@ class _GameSettingsState extends State { child: Text( "Spezielle Rollen", style: - Theme.of(context).textTheme.titleLarge, // Apply text theme + Theme.of(context).textTheme.titleLarge, ), ), Expanded( @@ -92,7 +92,7 @@ class _GameSettingsState extends State { role.stringValue, style: Theme.of(context) .textTheme - .bodyLarge, // Apply text theme + .bodyLarge, ), trailing: Switch( value: game.specialRoles[role], diff --git a/pubspec.lock b/pubspec.lock index 53007e5..36ac543 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -481,5 +481,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.4.3 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 4316417..ff4f1fb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: '>=3.0.0-313.0.dev <4.0.0' + sdk: '>=3.4.3 <4.0.0' dependencies: flip_card: ^0.7.0 @@ -20,5 +20,3 @@ dev_dependencies: flutter: uses-material-design: true - - diff --git a/test/gameboard_test..dart b/test/gameboard_test.dart similarity index 100% rename from test/gameboard_test..dart rename to test/gameboard_test.dart diff --git a/test/playerregistry_test.dart b/test/playerregistry_test.dart index 3245fa9..a6916fb 100644 --- a/test/playerregistry_test.dart +++ b/test/playerregistry_test.dart @@ -6,7 +6,7 @@ import 'package:werwolf/screens/settings.dart'; void main() { group('PlayerRegistry Tests', () { testWidgets('Adds a player to the list', (WidgetTester tester) async { - await tester.pumpWidget(MaterialApp(home: PlayerRegistry())); + await tester.pumpWidget(const MaterialApp(home: PlayerRegistry())); await tester.enterText(find.byType(TextField), 'Alice'); await tester.testTextInput.receiveAction(TextInputAction.done); @@ -16,7 +16,7 @@ void main() { }); testWidgets('Shows error for duplicate player', (WidgetTester tester) async { - await tester.pumpWidget(MaterialApp(home: PlayerRegistry())); + await tester.pumpWidget(const MaterialApp(home: PlayerRegistry())); await tester.enterText(find.byType(TextField), 'Alice'); await tester.testTextInput.receiveAction(TextInputAction.done); @@ -30,7 +30,7 @@ void main() { }); testWidgets('Navigates to GameSettings when enough players are added', (WidgetTester tester) async { - await tester.pumpWidget(MaterialApp(home: PlayerRegistry())); + await tester.pumpWidget(const MaterialApp(home: PlayerRegistry())); for (int i = 0; i < 6; i++) { await tester.enterText(find.byType(TextField), 'Player $i');