Skip to content

Commit 32e96a1

Browse files
committed
精简文本颜色代码
1 parent bd9dcaf commit 32e96a1

File tree

16 files changed

+32
-219
lines changed

16 files changed

+32
-219
lines changed

lib/components/add_store.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class _AddItemState extends State<AddItem> {
2323
width: 80,
2424
child: Text(
2525
widget.label,
26-
style: GoogleFonts.notoSansSc(
27-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
28-
),
2926
)
3027
),
3128
const SizedBox(width: 15,),
@@ -111,7 +108,6 @@ class _AddStoreState extends State<AddStore> {
111108
str,
112109
style: GoogleFonts.notoSansSc(
113110
fontSize: 14,
114-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
115111
),
116112
),
117113
);

lib/components/dialogs.dart

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ Future<void> showErrWarnDialog(BuildContext context, String title, String conten
1010
builder: (context)=>AlertDialog(
1111
title: Text(
1212
title,
13-
style: GoogleFonts.notoSansSc(
14-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
15-
),
1613
),
1714
content: Text(
1815
content,
19-
style: GoogleFonts.notoSansSc(
20-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
21-
),
2216
),
2317
actions: [
2418
ElevatedButton(
@@ -35,18 +29,8 @@ Future<bool> showConfirmDialog(BuildContext context, String title, String conten
3529
await showDialog(
3630
context: context,
3731
builder: (context)=>AlertDialog(
38-
title: Text(
39-
title,
40-
style: GoogleFonts.notoSansSc(
41-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
42-
),
43-
),
44-
content: Text(
45-
content,
46-
style: GoogleFonts.notoSansSc(
47-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
48-
),
49-
),
32+
title: Text(title),
33+
content: Text(content),
5034
actions: [
5135
TextButton(
5236
onPressed: () => Navigator.pop(context),
@@ -71,12 +55,7 @@ Future<void> showAbout(BuildContext context) async {
7155
showDialog(
7256
context: context,
7357
builder: (BuildContext context)=>AlertDialog(
74-
title: Text(
75-
'关于',
76-
style: GoogleFonts.notoSansSc(
77-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
78-
),
79-
),
58+
title: Text('关于'),
8059
content: Column(
8160
mainAxisSize: MainAxisSize.min,
8261
crossAxisAlignment: CrossAxisAlignment.center,
@@ -91,7 +70,6 @@ Future<void> showAbout(BuildContext context) async {
9170
style: GoogleFonts.notoSansSc(
9271
fontWeight: FontWeight.bold,
9372
fontSize: 18,
94-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
9573
),
9674
),
9775
const SizedBox(height: 3,),
@@ -125,7 +103,6 @@ Future<void> showAbout(BuildContext context) async {
125103
'项目地址',
126104
style: GoogleFonts.notoSansSc(
127105
fontSize: 13,
128-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
129106
),
130107
),
131108
)
@@ -157,7 +134,6 @@ Future<void> showAbout(BuildContext context) async {
157134
"许可证",
158135
style: GoogleFonts.notoSansSc(
159136
fontSize: 13,
160-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
161137
),
162138
),
163139
)
@@ -186,32 +162,17 @@ Future<int> freqDialogContent(BuildContext context, int storeFreq) async {
186162
await showDialog(
187163
context: context,
188164
builder: (context)=>AlertDialog(
189-
title: Text(
190-
"设置更新频率",
191-
style: GoogleFonts.notoSansSc(
192-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
193-
),
194-
),
165+
title: Text("设置更新频率"),
195166
content: StatefulBuilder(
196167
builder: (BuildContext context, StateSetter setState)=>SizedBox(
197168
width: 400,
198169
child: Column(
199170
mainAxisSize: MainAxisSize.min,
200171
crossAxisAlignment: CrossAxisAlignment.start,
201172
children: [
202-
Text(
203-
"注意,推荐最小更新时间为1.5s (1500毫秒)\n更新频率过高在一些下载服务器中可能会触发缓存机制",
204-
style: GoogleFonts.notoSansSc(
205-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
206-
),
207-
),
173+
Text("注意,推荐最小更新时间为1.5s (1500毫秒)\n更新频率过高在一些下载服务器中可能会触发缓存机制"),
208174
const SizedBox(height: 10,),
209-
Text(
210-
"$freq 毫秒 / ${freq/1000} 秒",
211-
style: GoogleFonts.notoSansSc(
212-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
213-
),
214-
),
175+
Text("$freq 毫秒 / ${freq/1000} 秒"),
215176
const SizedBox(height: 5,),
216177
SliderTheme(
217178
data: SliderThemeData(

lib/components/header/active_buttons.dart

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ Future<void> addTaskDialogM(BuildContext context) async {
4242
builder: (BuildContext context) => AlertDialog(
4343
title: Text(
4444
'添加任务',
45-
style: GoogleFonts.notoSansSc(
46-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
47-
),
4845
),
4946
content: SizedBox(
5047
width: 400,
@@ -56,9 +53,6 @@ Future<void> addTaskDialogM(BuildContext context) async {
5653
children: [
5754
Text(
5855
'若要添加多个任务,用回车拆分',
59-
style: GoogleFonts.notoSansSc(
60-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
61-
),
6256
),
6357
const SizedBox(height: 5,),
6458
ConstrainedBox(
@@ -147,12 +141,7 @@ Future<void> addTaskDialog(BuildContext context) async {
147141
showDialog(
148142
context: context,
149143
builder: (BuildContext context) => AlertDialog(
150-
title: Text(
151-
'添加任务',
152-
style: GoogleFonts.notoSansSc(
153-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
154-
),
155-
),
144+
title: Text('添加任务'),
156145
content: SizedBox(
157146
width: 400,
158147
child: StatefulBuilder(
@@ -173,12 +162,7 @@ Future<void> addTaskDialog(BuildContext context) async {
173162
crossAxisAlignment: CrossAxisAlignment.start,
174163
mainAxisSize: MainAxisSize.min,
175164
children: [
176-
Text(
177-
'若要添加多个任务,用回车拆分',
178-
style: GoogleFonts.notoSansSc(
179-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
180-
),
181-
),
165+
Text('若要添加多个任务,用回车拆分'),
182166
const SizedBox(height: 5,),
183167
ConstrainedBox(
184168
constraints: BoxConstraints(

lib/components/settings/setting_components.dart

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:bit_flow/types/store_item.dart';
66
import 'package:flutter/material.dart';
77
import 'package:flutter/services.dart';
88
import 'package:get/get.dart';
9-
import 'package:google_fonts/google_fonts.dart';
109

1110
class ConfigItem extends StatefulWidget {
1211

@@ -30,12 +29,7 @@ class _ConfigItemState extends State<ConfigItem> {
3029
width: 100,
3130
child: Align(
3231
alignment: Alignment.centerLeft,
33-
child: Text(
34-
widget.label,
35-
style: GoogleFonts.notoSansSc(
36-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
37-
),
38-
)
32+
child: Text(widget.label)
3933
)
4034
),
4135
const SizedBox(width: 10,),
@@ -78,9 +72,6 @@ class _ConfigItemWithTextFieldState extends State<ConfigItemWithTextField> {
7872
alignment: Alignment.centerLeft,
7973
child: Text(
8074
widget.label,
81-
style: GoogleFonts.notoSansSc(
82-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
83-
),
8475
)
8576
)
8677
),
@@ -100,9 +91,6 @@ class _ConfigItemWithTextFieldState extends State<ConfigItemWithTextField> {
10091
isCollapsed: true,
10192
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 10)
10293
),
103-
style: GoogleFonts.notoSansSc(
104-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
105-
),
10694
maxLines: widget.multiLine ? 3 : 1,
10795
)
10896
)
@@ -148,9 +136,6 @@ class SettingComponents {
148136
builder: (context)=>AlertDialog(
149137
title: Text(
150138
'配置Aria',
151-
style: GoogleFonts.notoSansSc(
152-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
153-
),
154139
),
155140
content: SizedBox(
156141
width: 350,
@@ -164,9 +149,6 @@ class SettingComponents {
164149
padding: const EdgeInsets.only(bottom: 10),
165150
child: Text(
166151
"速度和大小单位为Byte(/s)",
167-
style: GoogleFonts.notoSansSc(
168-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
169-
),
170152
),
171153
),
172154
ConfigItem(
@@ -275,9 +257,6 @@ class SettingComponents {
275257
builder: (context)=>AlertDialog(
276258
title: Text(
277259
"配置qBittorrent",
278-
style: GoogleFonts.notoSansSc(
279-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
280-
),
281260
),
282261
content: SizedBox(
283262
width: 350,
@@ -291,9 +270,6 @@ class SettingComponents {
291270
padding: const EdgeInsets.only(bottom: 10),
292271
child: Text(
293272
"速度和大小单位为Byte(/s)",
294-
style: GoogleFonts.notoSansSc(
295-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
296-
),
297273
),
298274
),
299275
ConfigItemWithTextField(

lib/components/settings/setting_item.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ class _SettingItemState extends State<SettingItem> {
3434
padding: const EdgeInsets.only(left: 5),
3535
child: Text(
3636
widget.label,
37-
style: GoogleFonts.notoSansSc(
38-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
39-
),
4037
),
4138
),
4239
),
@@ -187,14 +184,12 @@ class _DropDownContentState extends State<DropDownContent> {
187184
widget.selectedText,
188185
style: GoogleFonts.notoSansSc(
189186
fontSize: 14,
190-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
191187
),
192188
),
193189
const SizedBox(width: 10,),
194190
Icon(
195191
Icons.arrow_drop_down,
196192
size: 22,
197-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
198193
),
199194
],
200195
),
@@ -217,7 +212,6 @@ class _DropDownContentState extends State<DropDownContent> {
217212
item.label,
218213
style: GoogleFonts.notoSansSc(
219214
fontSize: 14,
220-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
221215
),
222216
),
223217
],

lib/components/sidebar/sidebar.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,12 @@ class _SidebarState extends State<Sidebar> {
6767
storeGet.servers[statusGet.sevrerIndex.value].name,
6868
style: GoogleFonts.notoSansSc(
6969
fontSize: 14,
70-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
7170
),
7271
)
7372
),
7473
Icon(
7574
Icons.arrow_drop_down,
7675
size: 22,
77-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
7876
),
7977
],
8078
),
@@ -90,7 +88,6 @@ class _SidebarState extends State<Sidebar> {
9088
name,
9189
style: GoogleFonts.notoSansSc(
9290
fontSize: 14,
93-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
9491
),
9592
overflow: TextOverflow.ellipsis,
9693
),

lib/components/sidebar/sidebar_components.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ class _SidebarButtonState extends State<SidebarButton> {
164164
const SizedBox(width: 5,),
165165
Text(
166166
widget.label,
167-
style: GoogleFonts.notoSansSc(
168-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
169-
),
170167
)
171168
],
172169
),

lib/components/task_components/active_task.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ class _ActiveTaskState extends State<ActiveTask> {
221221
Text(
222222
widget.item.name,
223223
overflow: TextOverflow.ellipsis,
224-
style: GoogleFonts.notoSansSc(
225-
// fontWeight: FontWeight.bold,
226-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
227-
),
228224
),
229225
Text(
230226
widget.item.sizeString(widget.item.size),

lib/components/task_components/finish_task.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@ class _FinishTaskState extends State<FinishTask> {
204204
Text(
205205
widget.item.name,
206206
overflow: TextOverflow.ellipsis,
207-
style: GoogleFonts.notoSansSc(
208-
// fontWeight: FontWeight.bold,
209-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
210-
),
211207
),
212208
Row(
213209
children: [

lib/getx/store_get.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:bit_flow/service/qbit.dart';
88
import 'package:bit_flow/types/store_item.dart';
99
import 'package:flutter/material.dart';
1010
import 'package:get/get.dart';
11-
import 'package:google_fonts/google_fonts.dart';
1211
import 'package:shared_preferences/shared_preferences.dart';
1312

1413
class StoreGet extends GetxController{
@@ -77,9 +76,6 @@ class StoreGet extends GetxController{
7776
return AlertDialog(
7877
title: Text(
7978
'添加一个下载服务器',
80-
style: GoogleFonts.notoSansSc(
81-
color: Theme.of(context).brightness==Brightness.dark ? Colors.white : Colors.black
82-
),
8379
),
8480
content: SizedBox(
8581
width: 400,

0 commit comments

Comments
 (0)