-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp_themes.dart
169 lines (154 loc) · 5.11 KB
/
app_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:themed/themed.dart';
class Font {
Font._();
static const fontFeatures = const <FontFeature>[
FontFeature.tabularFigures(),
FontFeature.liningFigures(),
FontFeature.slashedZero(),
];
static const small = TextStyleRef(
TextStyle(
inherit: false,
fontSize: 16,
color: AppColor.text,
fontWeight: FontWeight.normal,
textBaseline: TextBaseline.alphabetic,
fontFeatures: fontFeatures,
leadingDistribution: TextLeadingDistribution.even,
),
);
static const medium = TextStyleRef(
TextStyle(
inherit: false,
fontSize: 20,
color: AppColor.text,
fontWeight: FontWeight.normal,
textBaseline: TextBaseline.alphabetic,
fontFeatures: fontFeatures,
leadingDistribution: TextLeadingDistribution.even,
),
);
static const bold = TextStyleRef(
TextStyle(
inherit: false,
fontSize: 20,
color: AppColor.text,
fontWeight: FontWeight.bold,
textBaseline: TextBaseline.alphabetic,
fontFeatures: fontFeatures,
leadingDistribution: TextLeadingDistribution.even,
),
);
static const large = TextStyleRef(
TextStyle(
inherit: false,
fontSize: 20,
color: AppColor.text,
fontWeight: FontWeight.normal,
textBaseline: TextBaseline.alphabetic,
fontFeatures: fontFeatures,
leadingDistribution: TextLeadingDistribution.even,
),
);
static const giant = TextStyleRef(
TextStyle(
inherit: false,
fontSize: 26,
color: AppColor.text,
fontWeight: FontWeight.normal,
textBaseline: TextBaseline.alphabetic,
fontFeatures: fontFeatures,
leadingDistribution: TextLeadingDistribution.even,
),
);
}
class AppColor {
AppColor._();
static const text = ColorRef(const Color(0xF0000000), id: 'text');
static const textDimmed = ColorRef(const Color(0x60000000), id: 'dimmed');
static const bkg = ColorRef(const Color(0xFFFFFFFF), id: 'bkg');
static const bkgGray = ColorRef(const Color(0xFFE0E0E0), id: 'bkgGray');
static const blue = ColorRef(const Color(0xFF2196F3), id: 'blue');
static const darkBlue = ColorRef(const Color(0xFF263073), id: 'darkBlue');
static const green = ColorRef(const Color(0xFF309030), id: 'green');
static const buttonGreen = ColorRef(const Color(0xFF309030), id: 'buttonGreen');
static const darkGreen = ColorRef(const Color(0xFF306030), id: 'darkGreen');
static const red = ColorRef(const Color(0xFFAA2222), id: 'red');
static const buttonRed = ColorRef(const Color(0xFFAA2222), id: 'buttonRed');
static const white = ColorRef(const Color(0xFFFFFFFF), id: 'white');
}
Map<ThemeRef, Object> darkTheme = {
AppColor.text: const Color(0xFFFFFFFF),
AppColor.textDimmed: const Color(0x60FFFFFF),
AppColor.bkg: const Color(0xF0000000),
AppColor.bkgGray: const Color(0xF0222222),
AppColor.blue: const Color(0xFF2196F3),
AppColor.darkBlue: const Color(0xFF263073),
AppColor.green: const Color(0xFF26FF5C),
AppColor.buttonGreen: const Color(0xFF306030),
AppColor.darkGreen: const Color(0xFF306030),
AppColor.red: const Color(0xFFAA2222),
AppColor.buttonRed: const Color(0xFFAA2222),
AppColor.white: const Color(0xFFFFFFFF),
};
const SystemUiOverlayStyle appBarSystemUiOverlayStyle = SystemUiOverlayStyle(
//
// Only Android:
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
//
// Only iOS:
statusBarBrightness: Brightness.light,
);
void statusBarWithWhiteText([statusBarColor = Colors.transparent]) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
//
// Only Android:
statusBarColor: statusBarColor,
statusBarIconBrightness: Brightness.light,
//
// Only iOS:
statusBarBrightness: Brightness.dark,
),
);
}
void statusBarWithDarkText([statusBarColor = Colors.transparent]) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
//
// Only Android:
statusBarColor: statusBarColor,
statusBarIconBrightness: Brightness.dark,
//
// Only iOS:
statusBarBrightness: Brightness.light,
),
);
}
const double px4 = 4;
const double px8 = 8;
const double px12 = 12;
const double px16 = 16;
const double px20 = 20;
const double px24 = 24;
const double px28 = 28;
const double px32 = 32;
const double px36 = 36;
const double px48 = 48;
const double px64 = 64;
const double px80 = 80;
const Widget space0 = SizedBox();
const Widget space4 = SizedBox(width: px4, height: px4);
const Widget space8 = SizedBox(width: px8, height: px8);
const Widget space12 = SizedBox(width: px12, height: px12);
const Widget space16 = SizedBox(width: px16, height: px16);
const Widget space20 = SizedBox(width: px20, height: px20);
const Widget space24 = SizedBox(width: px24, height: px24);
const Widget space28 = SizedBox(width: px28, height: px28);
const Widget space32 = SizedBox(width: px32, height: px32);
const Widget space36 = SizedBox(width: px36, height: px36);
const Widget space48 = SizedBox(width: px48, height: px48);
const Widget space80 = SizedBox(width: px80, height: px80);