Added hide server address feature

This commit is contained in:
Juan Gilsanz Polo 2023-09-09 21:25:21 +02:00
parent a38c9bf4b0
commit d967399b64
5 changed files with 64 additions and 12 deletions

View file

@ -90,18 +90,20 @@ class HomeAppBar extends StatelessWidget {
if (serversProvider.selectedServer != null) ...[
Text(
server!.name,
style: const TextStyle(
style: !appConfigProvider.hideServerAddress ? const TextStyle(
fontSize: 20
),
) : null,
),
const SizedBox(height: 5),
Text(
"${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}",
style: TextStyle(
fontSize: 14,
color: Theme.of(context).listTileTheme.textColor
),
)
if (!appConfigProvider.hideServerAddress) ...[
const SizedBox(height: 5),
Text(
"${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}",
style: TextStyle(
fontSize: 14,
color: Theme.of(context).listTileTheme.textColor
),
)
]
],
if (serversProvider.selectedServer == null) Text(
AppLocalizations.of(context)!.noServerSelected,

View file

@ -159,6 +159,28 @@ class _GeneralSettingsState extends State<GeneralSettings> {
right: 10
)
),
CustomListTile(
icon: Icons.remove_red_eye_rounded,
title: AppLocalizations.of(context)!.hideServerAddress,
subtitle: AppLocalizations.of(context)!.hideServerAddressDescription,
trailing: Switch(
value: appConfigProvider.hideServerAddress,
onChanged: (value) => updateSettings(
newStatus: value,
function: appConfigProvider.setHideServerAddress
),
),
onTap: () => updateSettings(
newStatus: !appConfigProvider.hideServerAddress,
function: appConfigProvider.setHideServerAddress
),
padding: const EdgeInsets.only(
top: 10,
bottom: 10,
left: 16,
right: 10
)
),
SectionLabel(label: AppLocalizations.of(context)!.logs),
CustomListTile(
icon: Icons.timer_rounded,