From b2fcdf885d66f4b4f564f3192e8797fc8c148775 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Apr 2025 11:11:42 +0200 Subject: [PATCH] Theme changes --- lib/main.dart | 16 ++++++++++------ lib/utility/theme.dart | 30 +++++++++++++++++++++++++++++- lib/views/active_game_view.dart | 6 +++--- lib/views/create_game_view.dart | 24 ++++++++++++++---------- lib/views/mode_selection_view.dart | 5 +++-- lib/views/round_view.dart | 4 +--- 6 files changed, 60 insertions(+), 25 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 850a418..1b262f6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,4 @@ -import 'package:cabo_counter/utility/styles.dart'; +import 'package:cabo_counter/utility/theme.dart' as theme; import 'package:cabo_counter/views/main_menu_view.dart'; import 'package:flutter/cupertino.dart'; @@ -13,12 +13,16 @@ class App extends StatelessWidget { Widget build(BuildContext context) { return CupertinoApp( theme: CupertinoThemeData( - primaryColor: Styles.primaryColor, - textTheme: CupertinoTextThemeData( - primaryColor: Styles.primaryColor, - )), - home: MainMenuView(), + brightness: Brightness.dark, + primaryColor: theme.primaryColor, + scaffoldBackgroundColor: theme.backgroundColor, + textTheme: CupertinoTextThemeData( + primaryColor: theme.primaryColor, + ), + ), debugShowCheckedModeBanner: false, + title: 'CABO-Counter', + home: MainMenuView(), ); } } diff --git a/lib/utility/theme.dart b/lib/utility/theme.dart index c7d7e14..f2032cf 100644 --- a/lib/utility/theme.dart +++ b/lib/utility/theme.dart @@ -2,5 +2,33 @@ import 'package:flutter/cupertino.dart'; Color white = CupertinoColors.white; Color primaryColor = CupertinoColors.systemGreen; -Color backgroundColor = const Color(0xFF080808); +Color backgroundColor = const Color(0xFF101010); Color backgroundTintColor = CupertinoColors.darkBackgroundGray; + +TextStyle modeTitle = TextStyle( + color: primaryColor, + fontSize: 20, + fontWeight: FontWeight.bold, +); + +const TextStyle modeDescription = TextStyle( + fontSize: 16, +); + +TextStyle createGameTitle = TextStyle( + fontSize: 20, + color: primaryColor, + fontWeight: FontWeight.bold, +); + +TextStyle roundTitle = TextStyle( + fontSize: 60, + color: CupertinoColors.white, + fontWeight: FontWeight.bold, +); + +TextStyle roundPlayers = 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 3f85fc6..590378e 100644 --- a/lib/views/active_game_view.dart +++ b/lib/views/active_game_view.dart @@ -1,5 +1,5 @@ import 'package:cabo_counter/data_classes/game_session.dart'; -import 'package:cabo_counter/utility/styles.dart'; +import 'package:cabo_counter/utility/theme.dart' as theme; import 'package:cabo_counter/views/round_view.dart'; import 'package:flutter/cupertino.dart'; @@ -30,7 +30,7 @@ class _ActiveGameViewState extends State { padding: EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spieler:innen', - style: Styles.createGameTitle, + style: theme.createGameTitle, ), ), ListView.builder( @@ -63,7 +63,7 @@ class _ActiveGameViewState extends State { padding: EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Runden', - style: Styles.createGameTitle, + style: theme.createGameTitle, ), ), ListView.builder( diff --git a/lib/views/create_game_view.dart b/lib/views/create_game_view.dart index 7090d40..8cf8781 100644 --- a/lib/views/create_game_view.dart +++ b/lib/views/create_game_view.dart @@ -42,8 +42,9 @@ class _CreateGameState extends State { ), ), Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: EdgeInsets.fromLTRB(10, 10, 10, 0), child: CupertinoTextField( + decoration: BoxDecoration(), maxLength: 8, prefix: Text('Name'), textAlign: TextAlign.right, @@ -53,8 +54,9 @@ class _CreateGameState extends State { ), // Spielmodus-Auswahl mit Chevron Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), + padding: EdgeInsets.fromLTRB(10, 10, 10, 0), child: CupertinoTextField( + decoration: BoxDecoration(), readOnly: true, prefix: Text('Modus'), suffix: Row( @@ -148,16 +150,10 @@ class _CreateGameState extends State { } else { // Spieler-Einträge return Padding( - padding: const EdgeInsets.symmetric(vertical: 8.0), + padding: const EdgeInsets.symmetric( + vertical: 8.0, horizontal: 5), child: Row( children: [ - Expanded( - child: CupertinoTextField( - controller: _playerNameTextControllers[index], - placeholder: 'Spieler:in ${index + 1}', - padding: const EdgeInsets.all(12), - ), - ), CupertinoButton( padding: EdgeInsets.zero, child: Icon( @@ -172,6 +168,14 @@ class _CreateGameState extends State { }); }, ), + Expanded( + child: CupertinoTextField( + controller: _playerNameTextControllers[index], + placeholder: 'Spieler:in ${index + 1}', + padding: const EdgeInsets.all(12), + decoration: BoxDecoration(), + ), + ), ], ), ); diff --git a/lib/views/mode_selection_view.dart b/lib/views/mode_selection_view.dart index aa3c501..70e78fb 100644 --- a/lib/views/mode_selection_view.dart +++ b/lib/views/mode_selection_view.dart @@ -1,4 +1,5 @@ import 'package:cabo_counter/utility/styles.dart'; +import 'package:cabo_counter/utility/theme.dart' as theme; import 'package:flutter/cupertino.dart'; class ModeSelectionMenu extends StatelessWidget { @@ -23,14 +24,14 @@ class ModeSelectionMenu extends StatelessWidget { maxLines: 3, ), onTap: () { - Navigator.pop(context, '101 Pkt.'); + Navigator.pop(context, '101 Punkte'); }, ), ), Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: CupertinoListTile( - title: Text('Unbegrenzt', style: Styles.modeTitle), + title: Text('Unbegrenzt', style: theme.modeTitle), subtitle: const Text( 'Dem Spiel sind keine Grenzen gesetzt. Es wird so lange ' 'gespielt, bis die Spieler keine Lust mehr haben.', diff --git a/lib/views/round_view.dart b/lib/views/round_view.dart index ebf6699..15f9a6d 100644 --- a/lib/views/round_view.dart +++ b/lib/views/round_view.dart @@ -1,5 +1,4 @@ import 'package:cabo_counter/data_classes/game_session.dart'; -import 'package:cabo_counter/utility/styles.dart'; import 'package:cabo_counter/utility/theme.dart' as theme; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; @@ -46,7 +45,6 @@ class _RoundViewState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( - backgroundColor: Styles.backgroundColor, navigationBar: const CupertinoNavigationBar( transitionBetweenRoutes: true, middle: Text('Ergebnisse'), @@ -62,7 +60,7 @@ class _RoundViewState extends State { padding: const EdgeInsets.fromLTRB(0, 40, 0, 50), child: Text( 'Runde ${widget.roundNumber}', - style: Styles.roundTitle, + style: theme.roundTitle, ), ), Padding(