forked from garv-shah/aporia-network
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paththeme.dart
More file actions
187 lines (183 loc) · 6.62 KB
/
theme.dart
File metadata and controls
187 lines (183 loc) · 6.62 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/*
File: theme.dart
Description: Defines ThemeData for the rest of the app, with a utility class
Author: Garv Shah
Created: Sat Jun 18 18:29:00 2022
Doc Link: https://github.com/garv-shah/aporia-network#theme-data
*/
import 'package:flutter/material.dart';
import 'package:maths_club/widgets/forks/flowy_infra_ui/widget/theme_extension.dart';
TextStyle _getFontStyle({
String? fontFamily,
double? fontSize,
FontWeight? fontWeight,
Color? fontColor,
double? letterSpacing,
double? lineHeight,
}) =>
TextStyle(
fontFamily: fontFamily,
fontSize: fontSize ?? 12,
color: fontColor,
fontWeight: fontWeight ?? FontWeight.w500,
fontFamilyFallback: const ["Noto Color Emoji"],
letterSpacing: (fontSize ?? 12) * (letterSpacing ?? 0.005),
height: lineHeight,
);
class AppThemes {
static ThemeData lightTheme = ThemeData(
primaryColorLight: Colors.black,
primaryColor: const Color(0xfffcfcff),
scaffoldBackgroundColor: const Color(0xfffcfcff),
canvasColor: const Color(0xfffcfcff),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: Colors.deepPurpleAccent,
foregroundColor: Colors.white
),
appBarTheme: AppBarTheme(
color: Colors.deepPurple.shade100,
elevation: 4,
titleTextStyle: const TextStyle(
color: Colors.black,
fontSize: 20.0,
),
),
textTheme:
const TextTheme(
labelLarge: TextStyle(color: Colors.deepPurpleAccent),
bodyMedium: TextStyle(color: Colors.black)
),
inputDecorationTheme: InputDecorationTheme(
disabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.black38),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.black38),
borderRadius: BorderRadius.circular(8),
),
border: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.deepPurpleAccent),
borderRadius: BorderRadius.circular(8),
),
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.all(Colors.deepPurpleAccent),
side: const BorderSide(color: Color(0xff585858)),
), colorScheme: const ColorScheme.light().copyWith(
primary: Colors.deepPurpleAccent,
secondary: Colors.deepPurpleAccent.shade200,
tertiaryContainer: Colors.deepPurpleAccent.shade100.withAlpha(60),
brightness: Brightness.light).copyWith(background: const Color(0xfffcfcff)),
extensions: [
AFThemeExtension(
warning: const Color(0xffffd667),
success: const Color(0xff66cf80),
tint1: const Color(0xffe8e0ff),
tint2: const Color(0xffffe7fd),
tint3: const Color(0xffffe7ee),
tint4: const Color(0xffffefe3),
tint5: const Color(0xfffff2cd),
tint6: const Color(0xfff5ffdc),
tint7: const Color(0xffddffd6),
tint8: const Color(0xffdefff1),
tint9: const Color(0xffe1fbff),
textColor: const Color(0xff333333),
greyHover: const Color(0xffedeef2),
greySelect: const Color(0xffe2e4eb),
lightGreyHover: const Color(0xfff2f2f2),
toggleOffFill: const Color(0xffe0e0e0),
progressBarBGColor: const Color(0xffe1fbff),
toggleButtonBGColor: const Color(0xffe0e0e0),
code: _getFontStyle(
fontColor: const Color(0xff828282),
),
callout: _getFontStyle(
fontSize: 11,
fontColor: const Color(0xff828282),
),
caption: _getFontStyle(
fontSize: 11,
fontWeight: FontWeight.w400,
fontColor: const Color(0xff828282),
),
),
]
);
/// dark mode theme
static ThemeData darkTheme = ThemeData(
primaryColorLight: const Color(0xfffcfcff),
primaryColor: Colors.black,
scaffoldBackgroundColor: const Color(0xff12162B),
canvasColor: const Color(0xff12162B),
cardColor: const Color(0xff1F2547),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: Colors.indigoAccent,
foregroundColor: Colors.white
),
appBarTheme: const AppBarTheme(
color: Color(0xff1F2547),
elevation: 4,
titleTextStyle: TextStyle(
color: Colors.white,
fontSize: 20.0,
),
),
textTheme: const TextTheme(labelLarge: TextStyle(color: Colors.indigoAccent)),
inputDecorationTheme: InputDecorationTheme(
disabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.white38),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.white38),
borderRadius: BorderRadius.circular(8),
),
border: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.indigoAccent),
borderRadius: BorderRadius.circular(8),
),
),
checkboxTheme: const CheckboxThemeData(
side: BorderSide(color: Color(0xff585858)),
), colorScheme: const ColorScheme.dark().copyWith(
primary: Colors.indigoAccent,
secondary: Colors.indigoAccent,
tertiaryContainer: Colors.indigoAccent.shade100.withAlpha(60),
brightness: Brightness.dark).copyWith(background: Colors.black),
extensions: [
AFThemeExtension(
warning: const Color(0xffF7CF46),
success: const Color(0xff66CF80),
tint1: const Color(0xff8738F5),
tint2: const Color(0xffE6336E),
tint3: const Color(0xffFF2D9E),
tint4: const Color(0xffE9973E),
tint5: const Color(0xffFBF000),
tint6: const Color(0xffC0F000),
tint7: const Color(0xff15F74E),
tint8: const Color(0xff00F0E2),
tint9: const Color(0xff00BCF0),
textColor: const Color(0xffBBC3CD),
greyHover: const Color(0xff00BCF0), // dark main
greySelect: const Color(0xff00BCF0),
lightGreyHover: const Color(0xff363D49),
toggleOffFill: const Color(0xffBBC3CD),
progressBarBGColor: const Color(0xff363D49),
toggleButtonBGColor: const Color(0xffe0e0e0),
code: _getFontStyle(
fontColor: const Color(0xff363D49),
),
callout: _getFontStyle(
fontSize: 11,
fontColor: const Color(0xff363D49),
),
caption: _getFontStyle(
fontSize: 11,
fontWeight: FontWeight.w400,
fontColor: const Color(0xffBBC3CD),
),
),
]
);
}