From 93ebd4befe69a42ce693b1d1697b6a2b87290978 Mon Sep 17 00:00:00 2001 From: Oeyuu Date: Fri, 7 Jun 2024 20:49:32 +0200 Subject: [PATCH] changed leading and made buttons flexible --- lib/screens/flippingcards.dart | 68 ++++++++++++++++++---------------- lib/screens/settings.dart | 7 ---- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/lib/screens/flippingcards.dart b/lib/screens/flippingcards.dart index 9329483..d5c99dc 100644 --- a/lib/screens/flippingcards.dart +++ b/lib/screens/flippingcards.dart @@ -115,41 +115,45 @@ class _FlipingCardState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - OutlinedButton( - onPressed: () { - setState(() { - if (index > 0 && index <= widget.players.length) { - index--; - if (!_controller.state!.isFront) { - _controller.toggleCardWithoutAnimation(); + Flexible( + child: OutlinedButton( + onPressed: () { + setState(() { + if (index > 0 && index <= widget.players.length) { + index--; + if (!_controller.state!.isFront) { + _controller.toggleCardWithoutAnimation(); + } } - } - }); - }, - child: const Text("Zurück"), + }); + }, + child: const Text("Zurück"), + ), ), - ElevatedButton( - onPressed: () { - setState(() { - if (index >= 0 && index < widget.players.length - 1) { - index++; - if (!_controller.state!.isFront) { - _controller.toggleCardWithoutAnimation(); + Flexible( + child: ElevatedButton( + onPressed: () { + setState(() { + if (index >= 0 && index < widget.players.length - 1) { + index++; + if (!_controller.state!.isFront) { + _controller.toggleCardWithoutAnimation(); + } + } else if (index == widget.players.length - 1) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PlayerGridView(players: widget.players), + ), + ); } - } else if (index == widget.players.length - 1) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PlayerGridView(players: widget.players), - ), - ); - } - }); - }, - child: Text(index != widget.players.length - 1 - ? "Nächster Spieler" - : "Spiel anfangen!"), + }); + }, + child: Text(index != widget.players.length - 1 + ? "Nächster Spieler" + : "Spiel anfangen!"), + ), ), ], ), diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index 7fd9d47..d8cd3ca 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:werwolf/screens/flippingcards.dart'; import '../models/game.dart'; @@ -31,12 +30,6 @@ class _GameSettingsState extends State { style: Theme.of(context).textTheme.titleLarge, // Apply text theme ), centerTitle: true, - leading: IconButton( - icon: const Icon(FontAwesomeIcons.xmark), - onPressed: () { - Navigator.popUntil(context, ModalRoute.withName('/')); - }, - ), ), body: Padding( padding: const EdgeInsets.fromLTRB(30.0, 40.0, 30.0, 8.0),