@@ -610,6 +610,9 @@ class _SettingsPageState extends State<SettingsPage> {
610610 port = parts.elementAtOrNull (1 );
611611 }
612612
613+ // On these platforms, uses native http client for now and the proxy settings are not configurable.
614+ final proxyAutomated = isAndroid || isMacOS || isIOS;
615+
613616 final tr = context.t.settingsPage.advancedSection;
614617
615618 return [
@@ -622,35 +625,44 @@ class _SettingsPageState extends State<SettingsPage> {
622625 Navigator .push (context, MaterialPageRoute <void >(builder: (context) => const DebugShowcasePage ()));
623626 },
624627 ),
628+
629+ // Proxy settings, enable or disable.
625630 SectionSwitchListTile (
626631 secondary: Icon (MdiIcons .networkOutline),
627632 title: Text (tr.useProxy),
633+ subtitle: proxyAutomated ? Text (tr.proxySettings.automatedOnPlatform) : null ,
628634 value: netClientUseProxy,
629- onChanged: (v) {
630- context.read <SettingsBloc >().add (SettingsValueChanged (SettingsKeys .netClientUseProxy, v));
631- showSnackBar (context: context, message: context.t.general.affectAfterRestart);
632- },
635+ onChanged: proxyAutomated
636+ ? null
637+ : (v) {
638+ context.read <SettingsBloc >().add (SettingsValueChanged (SettingsKeys .netClientUseProxy, v));
639+ showSnackBar (context: context, message: context.t.general.affectAfterRestart);
640+ },
633641 ),
634- SectionSwitchListTile (
635- secondary: const Icon (Symbols .network_manage),
636- title: Text (tr.proxySettings.useDetectProxy.title),
637- subtitle: Text (tr.proxySettings.useDetectProxy.detail),
638- value: useDetectedProxy,
639- onChanged: netClientUseProxy
640- ? (v) async =>
641- context.read <SettingsBloc >().add (SettingsValueChanged (SettingsKeys .useDetectedProxyWhenStartup, v))
642- : null ,
643- ),
644- SectionListTile (
645- enabled: netClientUseProxy && ! useDetectedProxy,
646- leading: const Icon (Icons .network_locked_outlined),
647- title: Text (tr.proxySettings.title),
648- onTap: () async => showDialog <void >(
649- context: context,
650- builder: (context) => RootPage (DialogPaths .setupProxy, ProxySettingsDialog (host: host, port: port)),
651- barrierDismissible: false ,
642+
643+ if (! proxyAutomated)
644+ SectionSwitchListTile (
645+ secondary: const Icon (Symbols .network_manage),
646+ title: Text (tr.proxySettings.useDetectProxy.title),
647+ subtitle: Text (tr.proxySettings.useDetectProxy.detail),
648+ value: useDetectedProxy,
649+ onChanged: netClientUseProxy && ! proxyAutomated
650+ ? (v) async =>
651+ context.read <SettingsBloc >().add (SettingsValueChanged (SettingsKeys .useDetectedProxyWhenStartup, v))
652+ : null ,
653+ ),
654+
655+ if (! proxyAutomated)
656+ SectionListTile (
657+ enabled: netClientUseProxy && ! useDetectedProxy && ! proxyAutomated,
658+ leading: const Icon (Icons .network_locked_outlined),
659+ title: Text (tr.proxySettings.title),
660+ onTap: () async => showDialog <void >(
661+ context: context,
662+ builder: (context) => RootPage (DialogPaths .setupProxy, ProxySettingsDialog (host: host, port: port)),
663+ barrierDismissible: false ,
664+ ),
652665 ),
653- ),
654666
655667 // Export data.
656668 SectionListTile (
0 commit comments