From 8e4fe26ad9878054d5a26a9de9acbadb065f7db4 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 6 Mar 2026 22:09:58 +0100 Subject: [PATCH] Updated theme --- lib/core/custom_theme.dart | 24 ++++++++++++++++++- lib/main.dart | 22 ++++++++--------- .../widgets/text_input/custom_search_bar.dart | 1 - 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/lib/core/custom_theme.dart b/lib/core/custom_theme.dart index 0e9fec2..d1b158e 100644 --- a/lib/core/custom_theme.dart +++ b/lib/core/custom_theme.dart @@ -27,6 +27,9 @@ class CustomTheme { /// Text color used throughout the app static const Color textColor = Color(0xFFFFFFFF); + /// Text color used throughout the app + static const Color hintColor = Color(0xFF888888); + /// Background color for the navigation bar static const Color navBarBackgroundColor = Color(0xFF131313); @@ -65,7 +68,7 @@ class CustomTheme { boxShadow: [BoxShadow(color: primaryColor.withAlpha(120), blurRadius: 12)], ); - // ==================== App Bar Theme ==================== + // ==================== Component Themes ==================== static const AppBarTheme appBarTheme = AppBarTheme( backgroundColor: backgroundColor, foregroundColor: textColor, @@ -80,4 +83,23 @@ class CustomTheme { ), iconTheme: IconThemeData(color: textColor), ); + + static const SearchBarThemeData searchBarTheme = SearchBarThemeData( + textStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.textColor)), + hintStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.hintColor)), + ); + + static final RadioThemeData radioTheme = RadioThemeData( + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { + return CustomTheme.primaryColor; + } + return CustomTheme.textColor; + }), + ); + + static const InputDecorationTheme inputDecorationTheme = InputDecorationTheme( + labelStyle: TextStyle(color: CustomTheme.textColor), + hintStyle: TextStyle(color: CustomTheme.hintColor), + ); } diff --git a/lib/main.dart b/lib/main.dart index f5394b8..f159ef7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -29,25 +29,25 @@ class GameTracker extends StatelessWidget { return supportedLocale; } } - return supportedLocales.firstWhere((locale) => locale.languageCode == 'en'); + return supportedLocales.firstWhere( + (locale) => locale.languageCode == 'en', + ); }, debugShowCheckedModeBanner: false, onGenerateTitle: (context) => AppLocalizations.of(context).app_name, - themeMode: ThemeMode.dark, // forces dark mode + themeMode: ThemeMode.dark, theme: ThemeData( + // main colors primaryColor: CustomTheme.primaryColor, scaffoldBackgroundColor: CustomTheme.backgroundColor, + // themes appBarTheme: CustomTheme.appBarTheme, - radioTheme: RadioThemeData( - fillColor: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.selected)) { - return CustomTheme.primaryColor; - } - return CustomTheme.textColor; - }), - ), + inputDecorationTheme: CustomTheme.inputDecorationTheme, + searchBarTheme: CustomTheme.searchBarTheme, + radioTheme: CustomTheme.radioTheme, + // color scheme colorScheme: ColorScheme.fromSeed( - seedColor: CustomTheme.primaryColor, + seedColor: CustomTheme.textColor, brightness: Brightness.dark, primary: CustomTheme.primaryColor, onPrimary: CustomTheme.textColor, diff --git a/lib/presentation/widgets/text_input/custom_search_bar.dart b/lib/presentation/widgets/text_input/custom_search_bar.dart index 313fc1a..e5fc498 100644 --- a/lib/presentation/widgets/text_input/custom_search_bar.dart +++ b/lib/presentation/widgets/text_input/custom_search_bar.dart @@ -69,7 +69,6 @@ class CustomSearchBar extends StatelessWidget { constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45), hintText: hintText, onChanged: onChanged, - hintStyle: WidgetStateProperty.all(const TextStyle(fontSize: 16)), leading: const Icon(Icons.search), trailing: [ Visibility(