Skip to content

Commit 1ceca18

Browse files
committed
移除bangumi.dart,调整proxy_settings
1 parent 35f3710 commit 1ceca18

File tree

2 files changed

+9
-32
lines changed

2 files changed

+9
-32
lines changed

lib/pages/settings/proxy_settings.dart

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -297,35 +297,17 @@ class _ProxySettingsPageState extends State<ProxySettingsPage> {
297297
],
298298
],
299299
),
300-
SettingsSection(
301-
title: Text('操作', style: TextStyle(fontFamily: fontFamily)),
302-
tiles: [
303-
SettingsTile(
304-
title: Text('', style: TextStyle(fontFamily: fontFamily)),
305-
description: Row(
306-
children: [
307-
Expanded(
308-
child: OutlinedButton.icon(
309-
onPressed: testProxy,
310-
icon: const Icon(Icons.network_check),
311-
label: const Text('测试'),
312-
),
313-
),
314-
const SizedBox(width: 12),
315-
Expanded(
316-
child: FilledButton.icon(
317-
onPressed: saveProxySettings,
318-
icon: const Icon(Icons.save),
319-
label: const Text('保存'),
320-
),
321-
),
322-
],
323-
),
324-
),
325-
],
326-
),
327300
],
328301
),
302+
floatingActionButton: FloatingActionButton(
303+
onPressed: () async {
304+
await saveProxySettings();
305+
if (proxyUrl.isNotEmpty && ProxyUtils.isValidProxyUrl(proxyUrl)) {
306+
await testProxy();
307+
}
308+
},
309+
child: const Icon(Icons.save),
310+
),
329311
),
330312
);
331313
}

lib/request/bangumi.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ class BangumiHTTP {
208208
final res = await Request().get(
209209
Api.formatUrl(Api.bangumiAPIDomain + Api.bangumiInfoByID, [id]),
210210
);
211-
// 检查响应是否有效(排除错误响应)
212-
if (res.data is! Map<String, dynamic> || res.data['id'] == null) {
213-
KazumiLogger().e('Network: invalid response for bangumi info', error: res.data);
214-
return null;
215-
}
216211
return BangumiItem.fromJson(res.data);
217212
} catch (e) {
218213
KazumiLogger().e('Network: resolve bangumi item failed', error: e);

0 commit comments

Comments
 (0)