From 118aad550990abb4675fde0400b1ff3e9de19b07 Mon Sep 17 00:00:00 2001 From: MuZhou233 Date: Fri, 1 Mar 2024 21:16:39 +0000 Subject: [PATCH] fix: hide system proxy settings on web --- .../pages/settings/client/chore_setting.dart | 23 ++++++++++--------- .../settings/client/client_setting_page.dart | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/view/pages/settings/client/chore_setting.dart b/lib/view/pages/settings/client/chore_setting.dart index 6391fcf..fddd48e 100644 --- a/lib/view/pages/settings/client/chore_setting.dart +++ b/lib/view/pages/settings/client/chore_setting.dart @@ -14,17 +14,18 @@ class ChoreSetting extends StatelessWidget { child: ExpansionTile( title: const Text('杂项'), children: [ - ListTile( - title: const Text('使用系统代理(实验性)'), - trailing: Switch( - value: state.useSystemProxy ?? false, - onChanged: (value) { - context - .read() - .add(ChangeUseSystemProxyEvent(value)); - }, - ), - ) + if (!PlatformHelper.isWeb()) + ListTile( + title: const Text('使用系统代理(实验性)'), + trailing: Switch( + value: state.useSystemProxy ?? false, + onChanged: (value) { + context + .read() + .add(ChangeUseSystemProxyEvent(value)); + }, + ), + ) ], ), ), diff --git a/lib/view/pages/settings/client/client_setting_page.dart b/lib/view/pages/settings/client/client_setting_page.dart index 2c5aadc..7df9adc 100644 --- a/lib/view/pages/settings/client/client_setting_page.dart +++ b/lib/view/pages/settings/client/client_setting_page.dart @@ -5,6 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../../bloc/client_setting/client_setting_bloc.dart'; import '../../../../bloc/main_bloc.dart'; +import '../../../../common/platform.dart'; import '../../../../consts.dart'; import '../../../../l10n/l10n.dart'; import '../../../helper/spacing.dart';