dev
dart 249 lines 7.67 KB
Raw
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
4 import 'package:cake_wallet/themes/custom_theme_colors/dark_theme_custom_colors.dart';
5
6 class DarkTheme extends MaterialThemeBase {
7 @override
8 Brightness get brightness => Brightness.dark;
9
10 @override
11 ThemeMode get themeMode => ThemeMode.dark;
12
13 @override
14 Color get primaryColor => const Color(0xFF91B0FF);
15
16 @override
17 Color get secondaryColor => const Color(0xFFA1B9FF);
18
19 @override
20 Color get errorColor => const Color(0xFFFFB4AB);
21
22 @override
23 Color get surfaceColor => const Color(0xFF1B284A);
24
25 @override
26 Color get tertiaryColor => const Color(0xFF162028);
27
28 @override
29 ColorScheme get colorScheme => ColorScheme.dark(
30 primary: primaryColor,
31 onPrimary: const Color(0xFF002860),
32 primaryContainer: const Color(0xFF004C9E),
33 onPrimaryContainer: const Color(0xFFFFF3F0),
34 secondary: secondaryColor,
35 onSecondary: const Color(0xFF0C1C58),
36 secondaryContainer: const Color(0xFF1A3C6C),
37 onSecondaryContainer: const Color(0xFFBACBFF),
38 tertiary: tertiaryColor,
39 onTertiary: const Color(0xFF2B373F),
40 tertiaryContainer: const Color(0xFF1F2832),
41 onTertiaryContainer: const Color(0xFFA8B3C6),
42 error: errorColor,
43 onError: const Color(0xFFB71919),
44 errorContainer: const Color(0xFFC53636),
45 onErrorContainer: const Color(0xFFFFDAD6),
46 surface: surfaceColor,
47 onSurface: const Color(0xFFD7E2F7),
48 surfaceDim: const Color(0xFF0F1A36),
49 onSurfaceVariant: const Color(0xFF8C9FBB),
50 surfaceContainerLowest: Color(0xFF171C30),
51 surfaceContainerLow: Color(0xFF2D385C),
52 surfaceContainer: Color(0xFF24335B),
53 surfaceContainerHigh: Color(0xFF2A3E73),
54 surfaceContainerHighest: Color(0xFF334C8C),
55 outline: const Color(0xFF9EACC1),
56 outlineVariant: const Color(0xFF2A3E73),
57 );
58 static const String fontFamily = 'Wix Madefor Text';
59 @override
60 TextTheme get textTheme => TextTheme(
61 displayLarge: TextStyle(
62 fontSize: 57,
63 fontWeight: FontWeight.w400,
64 letterSpacing: -0.25,
65 color: colorScheme.onSurface,
66 ),
67 displayMedium: TextStyle(
68 fontSize: 45,
69 fontWeight: FontWeight.w400,
70 letterSpacing: 0,
71 color: colorScheme.onSurface,
72 ),
73 displaySmall: TextStyle(
74 fontSize: 36,
75 fontWeight: FontWeight.w400,
76 letterSpacing: 0,
77 color: colorScheme.onSurface,
78 ),
79 headlineLarge: TextStyle(
80 fontSize: 22,
81 fontWeight: FontWeight.w600,
82 letterSpacing: 0,
83 color: colorScheme.onSurface,
84 ),
85 headlineMedium: TextStyle(
86 fontSize: 18,
87 fontWeight: FontWeight.w600,
88 letterSpacing: 0,
89 color: colorScheme.onSurface,
90 ),
91 headlineSmall: TextStyle(
92 fontSize: 14,
93 fontWeight: FontWeight.w600,
94 letterSpacing: 0,
95 color: colorScheme.onSurface,
96 ),
97 titleLarge: TextStyle(
98 fontSize: 22,
99 fontWeight: FontWeight.w500,
100 letterSpacing: 0,
101 color: colorScheme.onSurface,
102 ),
103 titleMedium: TextStyle(
104 fontSize: 16,
105 fontWeight: FontWeight.w500,
106 letterSpacing: 0.15,
107 color: colorScheme.onSurface,
108 ),
109 titleSmall: TextStyle(
110 fontSize: 14,
111 fontWeight: FontWeight.w500,
112 letterSpacing: 0.1,
113 color: colorScheme.onSurface,
114 ),
115 bodyLarge: TextStyle(
116 fontSize: 16,
117 fontWeight: FontWeight.w400,
118 letterSpacing: 0.5,
119 color: colorScheme.onSurface,
120 ),
121 bodyMedium: TextStyle(
122 fontSize: 14,
123 fontWeight: FontWeight.w400,
124 letterSpacing: 0.25,
125 color: colorScheme.onSurface,
126 ),
127 bodySmall: TextStyle(
128 fontSize: 12,
129 fontWeight: FontWeight.w400,
130 letterSpacing: 0.4,
131 color: colorScheme.onSurface,
132 ),
133 labelLarge: TextStyle(
134 fontSize: 14,
135 fontWeight: FontWeight.w500,
136 letterSpacing: 0.1,
137 color: colorScheme.onSurface,
138 ),
139 labelMedium: TextStyle(
140 fontSize: 12,
141 fontWeight: FontWeight.w500,
142 letterSpacing: 0.5,
143 color: colorScheme.onSurface,
144 ),
145 labelSmall: TextStyle(
146 fontSize: 10,
147 fontWeight: FontWeight.w500,
148 letterSpacing: 0.5,
149 color: colorScheme.onSurface,
150 ),
151 );
152
153 @override
154 ThemeData get themeData => ThemeData(
155 useMaterial3: true,
156 fontFamily: fontFamily,
157 brightness: brightness,
158 colorScheme: colorScheme,
159 textTheme: textTheme,
160 appBarTheme: AppBarTheme(
161 backgroundColor: colorScheme.surface,
162 foregroundColor: colorScheme.onSurface,
163 elevation: 0,
164 ),
165 cardTheme: CardThemeData(
166 color: colorScheme.surface,
167 elevation: 1,
168 shape: RoundedRectangleBorder(
169 borderRadius: BorderRadius.circular(12),
170 ),
171 ),
172 elevatedButtonTheme: ElevatedButtonThemeData(
173 style: ElevatedButton.styleFrom(
174 backgroundColor: colorScheme.primary,
175 foregroundColor: colorScheme.onPrimary,
176 elevation: 0,
177 shape: RoundedRectangleBorder(
178 borderRadius: BorderRadius.circular(18),
179 ),
180 ),
181 ),
182 outlinedButtonTheme: OutlinedButtonThemeData(
183 style: OutlinedButton.styleFrom(
184 foregroundColor: colorScheme.primary,
185 side: BorderSide(color: colorScheme.outline),
186 shape: RoundedRectangleBorder(
187 borderRadius: BorderRadius.circular(18),
188 ),
189 ),
190 ),
191 textButtonTheme: TextButtonThemeData(
192 style: TextButton.styleFrom(
193 foregroundColor: colorScheme.primary,
194 shape: RoundedRectangleBorder(
195 borderRadius: BorderRadius.circular(18),
196 ),
197 ),
198 ),
199 inputDecorationTheme: InputDecorationTheme(
200 filled: true,
201 fillColor: colorScheme.surfaceContainer,
202 border: OutlineInputBorder(
203 borderRadius: BorderRadius.circular(18),
204 borderSide: BorderSide.none,
205 ),
206 enabledBorder: OutlineInputBorder(
207 borderRadius: BorderRadius.circular(18),
208 borderSide: BorderSide.none,
209 ),
210 focusedBorder: OutlineInputBorder(
211 borderRadius: BorderRadius.circular(18),
212 borderSide: BorderSide(color: colorScheme.primary),
213 ),
214 errorBorder: OutlineInputBorder(
215 borderRadius: BorderRadius.circular(18),
216 borderSide: BorderSide(color: colorScheme.error),
217 ),
218 focusedErrorBorder: OutlineInputBorder(
219 borderRadius: BorderRadius.circular(18),
220 borderSide: BorderSide(color: colorScheme.error),
221 ),
222 disabledBorder: OutlineInputBorder(
223 borderRadius: BorderRadius.circular(18),
224 borderSide: BorderSide.none,
225 ),
226 ),
227 );
228
229 @override
230 String get title => 'Dark Theme';
231
232 @override
233 ThemeType get type => ThemeType.dark;
234
235 @override
236 int get raw => 1;
237
238 @override
239 CustomThemeColors get customColors => DarkThemeCustomColors();
240
241 @override
242 String? get themeFamily => null;
243
244 @override
245 String? get accentColorId => null;
246
247 @override
248 String? get accentColorName => null;
249 }