From abb3db5f05fcbb69647f08472425f63f5d26cb31 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 27 Apr 2025 14:19:45 +0000 Subject: [PATCH] Actions: Auto-formatting [skip ci] --- lib/main.dart | 2 +- lib/utility/styles.dart | 6 +-- lib/utility/theme.dart | 4 +- lib/views/active_game_view.dart | 24 ++++++------ lib/views/create_game_view.dart | 68 ++++++++++++++++----------------- lib/views/information_view.dart | 22 +++++------ lib/views/main_menu_view.dart | 18 ++++----- lib/views/round_view.dart | 8 ++-- 8 files changed, 76 insertions(+), 76 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 1b262f6..53d2f11 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,7 +22,7 @@ class App extends StatelessWidget { ), debugShowCheckedModeBanner: false, title: 'CABO-Counter', - home: MainMenuView(), + home: const MainMenuView(), ); } } diff --git a/lib/utility/styles.dart b/lib/utility/styles.dart index 4095d2f..d0f2921 100644 --- a/lib/utility/styles.dart +++ b/lib/utility/styles.dart @@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart'; abstract class Styles { static Color primaryColor = CupertinoColors.systemGreen; - static Color backgroundColor = Color(0xFF080808); + static Color backgroundColor = const Color(0xFF080808); static TextStyle modeTitle = TextStyle( color: primaryColor, @@ -20,13 +20,13 @@ abstract class Styles { fontWeight: FontWeight.bold, ); - static TextStyle roundTitle = TextStyle( + static TextStyle roundTitle = const TextStyle( fontSize: 60, color: CupertinoColors.white, fontWeight: FontWeight.bold, ); - static TextStyle roundPlayers = TextStyle( + static TextStyle roundPlayers = const TextStyle( fontSize: 20, color: CupertinoColors.white, fontWeight: FontWeight.bold, diff --git a/lib/utility/theme.dart b/lib/utility/theme.dart index f2032cf..6b4f963 100644 --- a/lib/utility/theme.dart +++ b/lib/utility/theme.dart @@ -21,13 +21,13 @@ TextStyle createGameTitle = TextStyle( fontWeight: FontWeight.bold, ); -TextStyle roundTitle = TextStyle( +TextStyle roundTitle = const TextStyle( fontSize: 60, color: CupertinoColors.white, fontWeight: FontWeight.bold, ); -TextStyle roundPlayers = TextStyle( +TextStyle roundPlayers = const TextStyle( fontSize: 20, color: CupertinoColors.white, fontWeight: FontWeight.bold, diff --git a/lib/views/active_game_view.dart b/lib/views/active_game_view.dart index b22100d..e30fabb 100644 --- a/lib/views/active_game_view.dart +++ b/lib/views/active_game_view.dart @@ -25,7 +25,7 @@ class _ActiveGameViewState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spieler:innen', style: theme.createGameTitle, @@ -40,16 +40,16 @@ class _ActiveGameViewState extends State { title: Row( children: [ _getPlacementPrefix(index), - SizedBox(width: 5), + const SizedBox(width: 5), Text( widget.gameSession.players[playerIndex], - style: TextStyle(fontWeight: FontWeight.bold), + style: const TextStyle(fontWeight: FontWeight.bold), ), ], ), trailing: Row( children: [ - SizedBox(width: 5), + const SizedBox(width: 5), Text('${widget.gameSession.playerScores[playerIndex][0]} ' 'Punkte') ], @@ -58,7 +58,7 @@ class _ActiveGameViewState extends State { }, ), Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Runden', style: theme.createGameTitle, @@ -69,15 +69,15 @@ class _ActiveGameViewState extends State { itemCount: widget.gameSession.round, itemBuilder: (BuildContext context, int index) { return Padding( - padding: EdgeInsets.all(1), + padding: const EdgeInsets.all(1), child: CupertinoListTile( title: Text( 'Runde ${index + 1}', ), trailing: index + 1 != widget.gameSession.round || widget.gameSession.finished == true - ? (Text('\u{2705}', style: TextStyle(fontSize: 22))) - : Text('\u{23F3}', style: TextStyle(fontSize: 22)), + ? (const Text('\u{2705}', style: TextStyle(fontSize: 22))) + : const Text('\u{23F3}', style: TextStyle(fontSize: 22)), onTap: () async { // ignore: unused_local_variable final val = await Navigator.push( @@ -120,24 +120,24 @@ class _ActiveGameViewState extends State { Widget _getPlacementPrefix(int index) { switch (index) { case 0: - return Text( + return const Text( '\u{1F947}', style: TextStyle(fontSize: 22), ); case 1: - return Text( + return const Text( '\u{1F948}', style: TextStyle(fontSize: 22), ); case 2: - return Text( + return const Text( '\u{1F949}', style: TextStyle(fontSize: 22), ); default: return Text( ' ${index + 1}.', - style: TextStyle(fontWeight: FontWeight.bold), + style: const TextStyle(fontWeight: FontWeight.bold), ); } } diff --git a/lib/views/create_game_view.dart b/lib/views/create_game_view.dart index 00fdc04..a8bac99 100644 --- a/lib/views/create_game_view.dart +++ b/lib/views/create_game_view.dart @@ -24,9 +24,9 @@ class _CreateGameState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( - navigationBar: CupertinoNavigationBar( + navigationBar: const CupertinoNavigationBar( previousPageTitle: 'Übersicht', - middle: const Text('Neues Spiel'), + middle: Text('Neues Spiel'), ), child: SafeArea( child: Center( @@ -35,18 +35,18 @@ class _CreateGameState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spiel', style: Styles.createGameTitle, ), ), Padding( - padding: EdgeInsets.fromLTRB(10, 10, 10, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), child: CupertinoTextField( - decoration: BoxDecoration(), + decoration: const BoxDecoration(), maxLength: 8, - prefix: Text('Name'), + prefix: const Text('Name'), textAlign: TextAlign.right, placeholder: 'Titel des Spiels', controller: _gameTitleTextController, @@ -54,18 +54,18 @@ class _CreateGameState extends State { ), // Spielmodus-Auswahl mit Chevron Padding( - padding: EdgeInsets.fromLTRB(10, 10, 10, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), child: CupertinoTextField( - decoration: BoxDecoration(), + decoration: const BoxDecoration(), readOnly: true, - prefix: Text('Modus'), + prefix: const Text('Modus'), suffix: Row( children: [ Text( selectedMode ?? 'Wähle einen Modus', ), - SizedBox(width: 3), - CupertinoListTileChevron(), + const SizedBox(width: 3), + const CupertinoListTileChevron(), ], ), onTap: () async { @@ -73,7 +73,7 @@ class _CreateGameState extends State { final selected = await Navigator.push( context, CupertinoPageRoute( - builder: (context) => ModeSelectionMenu(), + builder: (context) => const ModeSelectionMenu(), ), ); @@ -87,7 +87,7 @@ class _CreateGameState extends State { ), ), Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spieler:innen', style: Styles.createGameTitle, @@ -104,9 +104,9 @@ class _CreateGameState extends State { padding: const EdgeInsets.symmetric(vertical: 8.0), child: CupertinoButton( padding: EdgeInsets.zero, - child: Row( + child: const Row( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ Icon( CupertinoIcons.add_circled, color: CupertinoColors.activeGreen, @@ -131,13 +131,13 @@ class _CreateGameState extends State { showCupertinoDialog( context: context, builder: (context) => CupertinoAlertDialog( - title: Text('Maximale Spielerzahl erreicht'), - content: Text( + title: const Text('Maximale Spielerzahl erreicht'), + content: const Text( 'Es können maximal 5 Spieler hinzugefügt ' 'werden.'), actions: [ CupertinoDialogAction( - child: Text('OK'), + child: const Text('OK'), onPressed: () => Navigator.pop(context), ), ], @@ -156,7 +156,7 @@ class _CreateGameState extends State { children: [ CupertinoButton( padding: EdgeInsets.zero, - child: Icon( + child: const Icon( CupertinoIcons.minus_circle_fill, color: CupertinoColors.destructiveRed, size: 25, @@ -173,7 +173,7 @@ class _CreateGameState extends State { controller: _playerNameTextControllers[index], placeholder: 'Spieler:in ${index + 1}', padding: const EdgeInsets.all(12), - decoration: BoxDecoration(), + decoration: const BoxDecoration(), ), ), ], @@ -186,9 +186,9 @@ class _CreateGameState extends State { Center( child: CupertinoButton( padding: EdgeInsets.zero, - child: Row( + child: const Row( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ Text( 'Spiel erstellen ', style: TextStyle( @@ -202,13 +202,13 @@ class _CreateGameState extends State { showCupertinoDialog( context: context, builder: (context) => CupertinoAlertDialog( - title: Text('Fehler'), + title: const Text('Fehler'), content: - Text('Es muss ein Titel für das Spiel eingegeben ' + const Text('Es muss ein Titel für das Spiel eingegeben ' 'werden.'), actions: [ CupertinoDialogAction( - child: Text('OK'), + child: const Text('OK'), onPressed: () => Navigator.pop(context), ), ], @@ -220,12 +220,12 @@ class _CreateGameState extends State { showCupertinoDialog( context: context, builder: (context) => CupertinoAlertDialog( - title: Text('Fehler'), + title: const Text('Fehler'), content: - Text('Es muss ein Spielmodus ausgewählt werden.'), + const Text('Es muss ein Spielmodus ausgewählt werden.'), actions: [ CupertinoDialogAction( - child: Text('OK'), + child: const Text('OK'), onPressed: () => Navigator.pop(context), ), ], @@ -237,13 +237,13 @@ class _CreateGameState extends State { showCupertinoDialog( context: context, builder: (context) => CupertinoAlertDialog( - title: Text('Fehler'), + title: const Text('Fehler'), content: - Text('Es müssen mindestens 2 Spieler hinzugefügt ' + const Text('Es müssen mindestens 2 Spieler hinzugefügt ' 'werden.'), actions: [ CupertinoDialogAction( - child: Text('OK'), + child: const Text('OK'), onPressed: () => Navigator.pop(context), ), ], @@ -255,11 +255,11 @@ class _CreateGameState extends State { showCupertinoDialog( context: context, builder: (context) => CupertinoAlertDialog( - title: Text('Fehler'), - content: Text('Jeder Spieler muss einen Namen haben.'), + title: const Text('Fehler'), + content: const Text('Jeder Spieler muss einen Namen haben.'), actions: [ CupertinoDialogAction( - child: Text('OK'), + child: const Text('OK'), onPressed: () => Navigator.pop(context), ), ], diff --git a/lib/views/information_view.dart b/lib/views/information_view.dart index 4e56be2..7d417fb 100644 --- a/lib/views/information_view.dart +++ b/lib/views/information_view.dart @@ -14,7 +14,7 @@ class InformationView extends StatelessWidget { @override Widget build(BuildContext context) { return CupertinoPageScaffold( - navigationBar: CupertinoNavigationBar( + navigationBar: const CupertinoNavigationBar( middle: Text('Über'), ), child: SafeArea( @@ -23,7 +23,7 @@ class InformationView extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( + const Padding( padding: EdgeInsets.fromLTRB(0, 10, 0, 0), child: Text( 'Cabo Counter', @@ -34,13 +34,13 @@ class InformationView extends StatelessWidget { ), ), Padding( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), child: SizedBox( height: 200, child: Image.asset('assets/cabo-counter-logo_rounded.png'), )), - Padding( + const Padding( padding: EdgeInsets.symmetric(horizontal: 30), child: Text( 'Hey :) Danke, dass du als eine:r der ersten User ' @@ -55,10 +55,10 @@ class InformationView extends StatelessWidget { textAlign: TextAlign.center, softWrap: true, )), - SizedBox( + const SizedBox( height: 30, ), - Text( + const Text( '\u00A9 Felix Kirchner', style: TextStyle(fontSize: 16), ), @@ -68,15 +68,15 @@ class InformationView extends StatelessWidget { IconButton( onPressed: () => launchUrl( Uri.parse('https://www.instagram.com/fx.kr')), - icon: Icon(FontAwesomeIcons.instagram)), + icon: const Icon(FontAwesomeIcons.instagram)), IconButton( onPressed: () => launchUrl( Uri.parse('mailto:felix.kirchner.fk@gmail.com')), - icon: Icon(CupertinoIcons.envelope)), + icon: const Icon(CupertinoIcons.envelope)), IconButton( onPressed: () => launchUrl( Uri.parse('https://www.github.com/flixcoo')), - icon: Icon(FontAwesomeIcons.github)), + icon: const Icon(FontAwesomeIcons.github)), ], ) ], @@ -95,12 +95,12 @@ class InformationView extends StatelessWidget { textAlign: TextAlign.center, ); } else if (snapshot.hasError) { - return Text( + return const Text( 'App-Version -.-.- (Build -)', textAlign: TextAlign.center, ); } - return Text( + return const Text( 'Lade Version...', textAlign: TextAlign.center, ); diff --git a/lib/views/main_menu_view.dart b/lib/views/main_menu_view.dart index 5c261bb..f5d453f 100644 --- a/lib/views/main_menu_view.dart +++ b/lib/views/main_menu_view.dart @@ -61,7 +61,7 @@ class _MainMenuViewState extends State { Navigator.push( context, CupertinoPageRoute( - builder: (context) => InformationView(), + builder: (context) => const InformationView(), ), ); }, @@ -88,27 +88,27 @@ class _MainMenuViewState extends State { itemBuilder: (context, index) { final session = gameSessionArray[index]; return Padding( - padding: EdgeInsets.symmetric(vertical: 10.0), + padding: const EdgeInsets.symmetric(vertical: 10.0), child: CupertinoListTile( title: Text(session.gameTitle), subtitle: session.finished == true ? Text( '\u{1F947} ${session.winner}', - style: TextStyle(fontSize: 14), + style: const TextStyle(fontSize: 14), ) : Text( 'Modus: ${_translateGameMode(session.pointLimit)}', - style: TextStyle(fontSize: 14), + style: const TextStyle(fontSize: 14), ), trailing: Row( children: [ Text('${session.round}'), - SizedBox(width: 3), - Icon(CupertinoIcons.arrow_2_circlepath_circle_fill), - SizedBox(width: 15), + const SizedBox(width: 3), + const Icon(CupertinoIcons.arrow_2_circlepath_circle_fill), + const SizedBox(width: 15), Text('${session.players.length}'), - SizedBox(width: 3), - Icon(CupertinoIcons.person_2_fill), + const SizedBox(width: 3), + const Icon(CupertinoIcons.person_2_fill), ], ), onTap: () async { diff --git a/lib/views/round_view.dart b/lib/views/round_view.dart index 58c5746..16dc226 100644 --- a/lib/views/round_view.dart +++ b/lib/views/round_view.dart @@ -147,12 +147,12 @@ class _RoundViewState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0), child: CupertinoListTile( - title: const Text('Spieler:in'), + title: Text('Spieler:in'), trailing: Row( - children: const [ + children: [ SizedBox( width: 100, child: Center(child: Text('Punkte'))),