From fc59bd332b2766eb4dac51501f2fdda3ad29ad1b Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Wed, 3 Nov 2021 12:53:32 -0700 Subject: [PATCH] restruct mobile from servers experiment and tab --- lib/views/globalsettingsview.dart | 40 +++++++++++++++++-------------- lib/views/profilemgrview.dart | 2 +- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 6f71f73d..5484263a 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/models/servers.dart'; import 'package:package_info_plus/package_info_plus.dart'; @@ -189,24 +190,27 @@ class _GlobalSettingsViewState extends State { inactiveTrackColor: settings.theme.defaultButtonDisabledColor(), secondary: Icon(CwtchIcons.enable_groups, color: settings.current().mainTextColor()), ), - SwitchListTile( - title: Text(AppLocalizations.of(context)!.settingServers, style: TextStyle(color: settings.current().mainTextColor())), - subtitle: Text(AppLocalizations.of(context)!.settingServersDescription), - value: settings.isExperimentEnabled(ServerManagementExperiment), - onChanged: (bool value) { - Provider.of(context, listen: false).clear(); - if (value) { - settings.enableExperiment(ServerManagementExperiment); - } else { - settings.disableExperiment(ServerManagementExperiment); - } - // Save Settings... - saveSettings(context); - }, - activeTrackColor: settings.theme.defaultButtonActiveColor(), - inactiveTrackColor: settings.theme.defaultButtonDisabledColor(), - secondary: Icon(CwtchIcons.dns_24px, color: settings.current().mainTextColor()), - ), + Visibility( + visible: !Platform.isAndroid && !Platform.isIOS, + child: + SwitchListTile( + title: Text(AppLocalizations.of(context)!.settingServers, style: TextStyle(color: settings.current().mainTextColor())), + subtitle: Text(AppLocalizations.of(context)!.settingServersDescription), + value: settings.isExperimentEnabled(ServerManagementExperiment), + onChanged: (bool value) { + Provider.of(context, listen: false).clear(); + if (value) { + settings.enableExperiment(ServerManagementExperiment); + } else { + settings.disableExperiment(ServerManagementExperiment); + } + // Save Settings... + saveSettings(context); + }, + activeTrackColor: settings.theme.defaultButtonActiveColor(), + inactiveTrackColor: settings.theme.defaultButtonDisabledColor(), + secondary: Icon(CwtchIcons.dns_24px, color: settings.current().mainTextColor()), + )), SwitchListTile( title: Text(AppLocalizations.of(context)!.settingFileSharing, style: TextStyle(color: settings.current().mainTextColor())), subtitle: Text(AppLocalizations.of(context)!.descriptionFileSharing), diff --git a/lib/views/profilemgrview.dart b/lib/views/profilemgrview.dart index e0a150e1..e33209c0 100644 --- a/lib/views/profilemgrview.dart +++ b/lib/views/profilemgrview.dart @@ -99,7 +99,7 @@ class _ProfileMgrViewState extends State { )); // Servers - if (Provider.of(context).isExperimentEnabled(ServerManagementExperiment)) { + if (Provider.of(context).isExperimentEnabled(ServerManagementExperiment) && !Platform.isAndroid && !Platform.isIOS) { actions.add(IconButton(icon: Icon(CwtchIcons.dns_black_24dp), tooltip: AppLocalizations.of(context)!.serversManagerTitleShort, onPressed: _pushServers)); }