Skip to content

Commit a15cc84

Browse files
committed
🧪 only dev
1 parent 0c4ae4c commit a15cc84

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

lib/widgets/rss/rss_cmc_card.dart

+22-20
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import 'package:dart_rss/dart_rss.dart';
33
import 'package:file_selector/file_selector.dart';
44
import 'package:fluent_ui/fluent_ui.dart';
5+
import 'package:flutter/foundation.dart';
56
import 'package:flutter_riverpod/flutter_riverpod.dart';
67
import 'package:flutter_screenutil/flutter_screenutil.dart';
78
import 'package:jiffy/jiffy.dart';
@@ -60,30 +61,31 @@ class _RssCmcCardState extends ConsumerState<RssCmcCard> {
6061
},
6162
),
6263
),
63-
Tooltip(
64-
message: '内置下载',
65-
child: IconButton(
66-
icon: Icon(FluentIcons.download, color: color),
67-
onPressed: () async {
68-
var saveDir = await getDirectoryPath();
69-
if (saveDir == null || saveDir.isEmpty) {
70-
if (context.mounted) await BtInfobar.error(context, '未选择下载目录');
71-
return;
72-
}
73-
var check = await ref.read(dttStoreProvider.notifier).addTask(
74-
item,
75-
saveDir,
76-
);
77-
if (check) {
78-
if (context.mounted) {
64+
if (kDebugMode)
65+
Tooltip(
66+
message: '内置下载',
67+
child: IconButton(
68+
icon: Icon(FluentIcons.download, color: color),
69+
onPressed: () async {
70+
var saveDir = await getDirectoryPath();
71+
if (saveDir == null || saveDir.isEmpty) {
72+
if (context.mounted) {
73+
await BtInfobar.error(context, '未选择下载目录');
74+
}
75+
return;
76+
}
77+
var check = await ref.read(dttStoreProvider.notifier).addTask(
78+
item,
79+
saveDir,
80+
);
81+
if (check && context.mounted) {
7982
await BtInfobar.success(context, '添加下载任务成功');
83+
return;
8084
}
81-
} else {
8285
if (context.mounted) await BtInfobar.warn(context, '已经在下载列表中');
83-
}
84-
},
86+
},
87+
),
8588
),
86-
),
8789
Tooltip(
8890
message: '打开链接',
8991
child: IconButton(

lib/widgets/rss/rss_mk_card.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import 'package:dart_rss/domain/rss_item.dart';
33
import 'package:file_selector/file_selector.dart';
44
import 'package:fluent_ui/fluent_ui.dart';
5+
import 'package:flutter/foundation.dart';
56
import 'package:flutter_riverpod/flutter_riverpod.dart';
67
import 'package:jiffy/jiffy.dart';
78
import 'package:url_launcher/url_launcher_string.dart';
@@ -182,7 +183,7 @@ class _RssMikanCardState extends ConsumerState<RssMikanCard> {
182183
return Row(
183184
mainAxisAlignment: MainAxisAlignment.end,
184185
children: [
185-
buildActInner(context),
186+
if (kDebugMode) buildActInner(context),
186187
buildActMotrix(context),
187188
buildActLink(context),
188189
],

0 commit comments

Comments
 (0)