-
Notifications
You must be signed in to change notification settings - Fork 554
/
themes.dart
62 lines (58 loc) · 1.81 KB
/
themes.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import 'package:flutter/material.dart';
// This file is adapted from
// https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/gallery/themes.dart
final kLightTheme = _buildLightTheme();
final kDarkTheme = _buildDarkTheme();
const _primaryColor = Color(0xFF0175c2);
const _secondaryColor = Color(0xFF13B9FD);
ThemeData _buildLightTheme() {
final colorScheme = const ColorScheme.light().copyWith(
primary: _primaryColor,
secondary: _secondaryColor,
surface: Colors.white,
error: const Color(0xFFB00020),
);
return ThemeData(
useMaterial3: false,
brightness: Brightness.light,
colorScheme: colorScheme,
primaryColor: _primaryColor,
indicatorColor: Colors.white,
splashColor: Colors.white24,
splashFactory: InkRipple.splashFactory,
canvasColor: Colors.white,
scaffoldBackgroundColor: Colors.white,
buttonTheme: ButtonThemeData(
colorScheme: colorScheme,
textTheme: ButtonTextTheme.primary,
),
pageTransitionsTheme: PageTransitionsTheme(
builders: {
for (final p in TargetPlatform.values)
p: CupertinoPageTransitionsBuilder()
},
),
);
}
ThemeData _buildDarkTheme() {
final colorScheme = const ColorScheme.dark().copyWith(
primary: _primaryColor,
secondary: _secondaryColor,
surface: const Color(0xFF202124),
error: const Color(0xFFB00020),
);
return ThemeData(
useMaterial3: false,
brightness: Brightness.dark,
primaryColor: _primaryColor,
primaryColorDark: const Color(0xFF0050a0),
primaryColorLight: _secondaryColor,
indicatorColor: Colors.white,
canvasColor: const Color(0xFF202124),
scaffoldBackgroundColor: const Color(0xFF202124),
buttonTheme: ButtonThemeData(
colorScheme: colorScheme,
textTheme: ButtonTextTheme.primary,
),
);
}