Move advanced toggle to app bar
This commit is contained in:
parent
9eaa52e5e4
commit
6a26821766
2 changed files with 37 additions and 20 deletions
|
|
@ -21,6 +21,7 @@
|
|||
"preventSuspendLabel": "Prevent suspend",
|
||||
"disableElasticityLabel": "Disable elasticity",
|
||||
"stopDetectionLabel": "Stop detection",
|
||||
"advancedLabel": "Show advanced settings",
|
||||
"trackingLabel": "Continuous tracking",
|
||||
"startAction": "Start service",
|
||||
"stopAction": "Stop service",
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
bool preventSuspend = false;
|
||||
bool disableElasticity = false;
|
||||
bool stopDetection = false;
|
||||
bool advanced = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -132,7 +133,20 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.settingsTitle)),
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.settingsTitle),
|
||||
actions: [
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context)!.advancedLabel),
|
||||
Switch(
|
||||
value: advanced,
|
||||
onChanged: (value) => setState(() => advanced = value),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
_buildListTile(AppLocalizations.of(context)!.idLabel, Preferences.id, false),
|
||||
|
|
@ -151,6 +165,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
setState(() => buffering = value);
|
||||
},
|
||||
),
|
||||
if (advanced)
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.disableElasticityLabel),
|
||||
value: disableElasticity,
|
||||
|
|
@ -160,6 +175,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
setState(() => disableElasticity = value);
|
||||
},
|
||||
),
|
||||
if (advanced)
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.stopDetectionLabel),
|
||||
value: stopDetection,
|
||||
|
|
@ -169,7 +185,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
setState(() => stopDetection = value);
|
||||
},
|
||||
),
|
||||
if (Platform.isIOS)
|
||||
if (advanced && Platform.isIOS)
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.preventSuspendLabel),
|
||||
value: preventSuspend,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue