diff --git a/lib/main.dart b/lib/main.dart index 9580339..47e0381 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,4 @@ -import 'package:cabo_counter/utility/theme.dart' as theme; +import 'package:cabo_counter/utility/theme.dart'; import 'package:cabo_counter/views/main_menu_view.dart'; import 'package:flutter/cupertino.dart'; @@ -14,10 +14,10 @@ class App extends StatelessWidget { return CupertinoApp( theme: CupertinoThemeData( brightness: Brightness.dark, - primaryColor: theme.primaryColor, - scaffoldBackgroundColor: theme.backgroundColor, + primaryColor: Theme.primaryColor, + scaffoldBackgroundColor: Theme.backgroundColor, textTheme: CupertinoTextThemeData( - primaryColor: theme.primaryColor, + primaryColor: Theme.primaryColor, ), ), debugShowCheckedModeBanner: false, diff --git a/lib/utility/theme.dart b/lib/utility/theme.dart index 6b4f963..8d8ec8e 100644 --- a/lib/utility/theme.dart +++ b/lib/utility/theme.dart @@ -1,34 +1,36 @@ import 'package:flutter/cupertino.dart'; -Color white = CupertinoColors.white; -Color primaryColor = CupertinoColors.systemGreen; -Color backgroundColor = const Color(0xFF101010); -Color backgroundTintColor = CupertinoColors.darkBackgroundGray; +class Theme { + static Color white = CupertinoColors.white; + static Color primaryColor = CupertinoColors.systemGreen; + static Color backgroundColor = const Color(0xFF101010); + static Color backgroundTintColor = CupertinoColors.darkBackgroundGray; -TextStyle modeTitle = TextStyle( - color: primaryColor, - fontSize: 20, - fontWeight: FontWeight.bold, -); + static TextStyle modeTitle = TextStyle( + color: primaryColor, + fontSize: 20, + fontWeight: FontWeight.bold, + ); -const TextStyle modeDescription = TextStyle( - fontSize: 16, -); + static const TextStyle modeDescription = TextStyle( + fontSize: 16, + ); -TextStyle createGameTitle = TextStyle( - fontSize: 20, - color: primaryColor, - fontWeight: FontWeight.bold, -); + static TextStyle createGameTitle = TextStyle( + fontSize: 20, + color: primaryColor, + fontWeight: FontWeight.bold, + ); -TextStyle roundTitle = const TextStyle( - fontSize: 60, - color: CupertinoColors.white, - fontWeight: FontWeight.bold, -); + static TextStyle roundTitle = TextStyle( + fontSize: 60, + color: white, + fontWeight: FontWeight.bold, + ); -TextStyle roundPlayers = const TextStyle( - fontSize: 20, - color: CupertinoColors.white, - fontWeight: FontWeight.bold, -); + static TextStyle roundPlayers = TextStyle( + fontSize: 20, + color: white, + fontWeight: FontWeight.bold, + ); +} diff --git a/lib/views/active_game_view.dart b/lib/views/active_game_view.dart index 59d3a1b..10c296f 100644 --- a/lib/views/active_game_view.dart +++ b/lib/views/active_game_view.dart @@ -1,5 +1,5 @@ import 'package:cabo_counter/data/game_session.dart'; -import 'package:cabo_counter/utility/theme.dart' as theme; +import 'package:cabo_counter/utility/theme.dart'; import 'package:cabo_counter/views/round_view.dart'; import 'package:flutter/cupertino.dart'; @@ -28,7 +28,7 @@ class _ActiveGameViewState extends State { padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spieler:innen', - style: theme.createGameTitle, + style: Theme.createGameTitle, ), ), ListView.builder( @@ -61,7 +61,7 @@ class _ActiveGameViewState extends State { padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Runden', - style: theme.createGameTitle, + style: Theme.createGameTitle, ), ), ListView.builder( diff --git a/lib/views/create_game_view.dart b/lib/views/create_game_view.dart index 14e961b..a239337 100644 --- a/lib/views/create_game_view.dart +++ b/lib/views/create_game_view.dart @@ -1,5 +1,5 @@ import 'package:cabo_counter/data/game_session.dart'; -import 'package:cabo_counter/utility/theme.dart' as theme; +import 'package:cabo_counter/utility/theme.dart'; import 'package:cabo_counter/views/active_game_view.dart'; import 'package:cabo_counter/views/mode_selection_view.dart'; import 'package:flutter/cupertino.dart'; @@ -42,7 +42,7 @@ class _CreateGameState extends State { padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spiel', - style: theme.createGameTitle, + style: Theme.createGameTitle, ), ), Padding( @@ -96,7 +96,7 @@ class _CreateGameState extends State { padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( 'Spieler:innen', - style: theme.createGameTitle, + style: Theme.createGameTitle, ), ), Expanded( diff --git a/lib/views/mode_selection_view.dart b/lib/views/mode_selection_view.dart index 5876618..949060b 100644 --- a/lib/views/mode_selection_view.dart +++ b/lib/views/mode_selection_view.dart @@ -1,4 +1,4 @@ -import 'package:cabo_counter/utility/theme.dart' as theme; +import 'package:cabo_counter/utility/theme.dart'; import 'package:flutter/cupertino.dart'; class ModeSelectionMenu extends StatelessWidget { @@ -15,10 +15,10 @@ class ModeSelectionMenu extends StatelessWidget { Padding( padding: const EdgeInsets.fromLTRB(0, 16, 0, 0), child: CupertinoListTile( - title: Text('101 Punkte', style: theme.modeTitle), + title: Text('101 Punkte', style: Theme.modeTitle), subtitle: const Text( 'Es wird solange gespielt, bis einer Spieler mehr als 100 Punkte erreicht', - style: theme.modeDescription, + style: Theme.modeDescription, maxLines: 3, ), onTap: () { @@ -29,11 +29,11 @@ class ModeSelectionMenu extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: CupertinoListTile( - title: Text('Unbegrenzt', style: theme.modeTitle), + title: Text('Unbegrenzt', style: Theme.modeTitle), subtitle: const Text( 'Dem Spiel sind keine Grenzen gesetzt. Es wird so lange ' 'gespielt, bis Ihr keine Lust mehr habt.', - style: theme.modeDescription, + style: Theme.modeDescription, maxLines: 3, ), onTap: () { diff --git a/lib/views/round_view.dart b/lib/views/round_view.dart index 9520aa5..ec6a3c8 100644 --- a/lib/views/round_view.dart +++ b/lib/views/round_view.dart @@ -1,5 +1,5 @@ import 'package:cabo_counter/data/game_session.dart'; -import 'package:cabo_counter/utility/theme.dart' as theme; +import 'package:cabo_counter/utility/theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; @@ -86,7 +86,7 @@ class _RoundViewState extends State { children: [ const SizedBox(height: 40), Text('Runde ${widget.roundNumber}', - style: theme.roundTitle), + style: Theme.roundTitle), const SizedBox(height: 10), const Text( 'Wer hat CABO gesagt?', @@ -101,8 +101,8 @@ class _RoundViewState extends State { child: SizedBox( height: 40, child: CupertinoSegmentedControl( - unselectedColor: theme.backgroundTintColor, - selectedColor: theme.primaryColor, + unselectedColor: Theme.backgroundTintColor, + selectedColor: Theme.primaryColor, groupValue: _caboPlayerIndex, children: Map.fromEntries(widget.gameSession.players .asMap() @@ -267,7 +267,7 @@ class _RoundViewState extends State { return Container( height: 80, padding: const EdgeInsets.only(bottom: 20), - color: theme.backgroundTintColor, + color: Theme.backgroundTintColor, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [