diff --git a/lib/themes.dart b/lib/themes.dart index 222a59c..9e170be 100644 --- a/lib/themes.dart +++ b/lib/themes.dart @@ -1,5 +1,3 @@ -// ignore_for_file: deprecated_member_use - import 'package:flutter/material.dart'; // This file is adapted from @@ -7,62 +5,52 @@ import 'package:flutter/material.dart'; final kLightTheme = _buildLightTheme(); final kDarkTheme = _buildDarkTheme(); +const _primaryColor = Color(0xFF0175c2); +const _secondaryColor = Color(0xFF13B9FD); ThemeData _buildLightTheme() { - const Color primaryColor = Color(0xFF0175c2); - const Color secondaryColor = Color(0xFF13B9FD); - final ColorScheme colorScheme = const ColorScheme.light().copyWith( - primary: primaryColor, - secondary: secondaryColor, + final colorScheme = const ColorScheme.light().copyWith( + primary: _primaryColor, + secondary: _secondaryColor, + background: Colors.white, + error: const Color(0xFFB00020), ); - final ThemeData base = ThemeData( + return ThemeData( + useMaterial3: false, brightness: Brightness.light, colorScheme: colorScheme, - primaryColor: primaryColor, + primaryColor: _primaryColor, indicatorColor: Colors.white, - toggleableActiveColor: const Color(0xFF1E88E5), splashColor: Colors.white24, splashFactory: InkRipple.splashFactory, canvasColor: Colors.white, scaffoldBackgroundColor: Colors.white, - backgroundColor: Colors.white, - errorColor: const Color(0xFFB00020), buttonTheme: ButtonThemeData( colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, ), ); - return base.copyWith( - textTheme: base.textTheme, - primaryTextTheme: base.primaryTextTheme, - ); } ThemeData _buildDarkTheme() { - const Color primaryColor = Color(0xFF0175c2); - const Color secondaryColor = Color(0xFF13B9FD); - final ColorScheme colorScheme = const ColorScheme.dark().copyWith( - primary: primaryColor, - secondary: secondaryColor, + final colorScheme = const ColorScheme.dark().copyWith( + primary: _primaryColor, + secondary: _secondaryColor, + background: const Color(0xFF202124), + error: const Color(0xFFB00020), ); - final ThemeData base = ThemeData( + return ThemeData( + useMaterial3: false, brightness: Brightness.dark, - primaryColor: primaryColor, + primaryColor: _primaryColor, primaryColorDark: const Color(0xFF0050a0), - primaryColorLight: secondaryColor, + primaryColorLight: _secondaryColor, indicatorColor: Colors.white, - toggleableActiveColor: const Color(0xFF6997DF), canvasColor: const Color(0xFF202124), scaffoldBackgroundColor: const Color(0xFF202124), - backgroundColor: const Color(0xFF202124), - errorColor: const Color(0xFFB00020), buttonTheme: ButtonThemeData( colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, ), ); - return base.copyWith( - textTheme: base.textTheme, - primaryTextTheme: base.primaryTextTheme, - ); }