++ tests and analyze
parent
298390170c
commit
f6fa31196e
|
@ -27,7 +27,7 @@ class _GameSettingsState extends State<GameSettings> {
|
|||
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<GameSettings> {
|
|||
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<GameSettings> {
|
|||
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<GameSettings> {
|
|||
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<GameSettings> {
|
|||
role.stringValue,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyLarge, // Apply text theme
|
||||
.bodyLarge,
|
||||
),
|
||||
trailing: Switch(
|
||||
value: game.specialRoles[role],
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue