-
Notifications
You must be signed in to change notification settings - Fork 1
/
01SetTheme.dart
46 lines (46 loc) · 1.25 KB
/
01SetTheme.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Set Default Theme
// first declare a theme
final ThemeData _kShrineTheme = _buildShrineTheme();
ThemeData _buildShrineTheme() {
final ThemeData base = ThemeData.light();
return base.copyWith(
colorScheme: base.colorScheme.copyWith(
primary: kShrinePink100,
onPrimary: kShrineBrown900,
secondary: kShrineBrown900,
error: kShrineErrorRed,
),
textTheme: _buildShrineTextTheme(base.textTheme),
textSelectionTheme: const TextSelectionThemeData(
selectionColor: kShrinePink100,
),
);
inputDecorationTheme:
const InputDecorationTheme(
border: OutlineInputBorder(),
);
}
// And textTheme
TextTheme _buildShrineTextTheme(TextTheme base) {
return base
.copyWith(
headlineSmall:
base.headlineSmall!.copyWith(fontWeight: FontWeight.w500),
titleLarge: base.titleLarge!.copyWith(
fontSize: 18,
),
bodySmall: base.bodySmall!.copyWith(
fontWeight: FontWeight.w400,
fontSize: 14,
),
bodyLarge: base.bodyLarge!.copyWith(
fontWeight: FontWeight.w500,
fontSize: 16,
),
)
.apply(
fontFamily: 'Rubik',
displayColor: kShrineBrown900,
bodyColor: kShrineBrown900,
);
}