Add wake lock settings
This commit is contained in:
parent
b903d7ab6f
commit
e0f2bde919
3 changed files with 16 additions and 4 deletions
|
|
@ -15,9 +15,10 @@ class SettingsScreen extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _SettingsScreenState extends State<SettingsScreen> {
|
||||
bool buffering = true;
|
||||
bool stopDetection = false;
|
||||
bool advanced = false;
|
||||
bool buffering = true;
|
||||
bool wakelock = false;
|
||||
bool stopDetection = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -28,6 +29,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
void _initState() async {
|
||||
setState(() {
|
||||
buffering = Preferences.instance.getBool(Preferences.buffer) ?? true;
|
||||
wakelock = Preferences.instance.getBool(Preferences.wakelock) ?? false;
|
||||
stopDetection = Preferences.instance.getBool(Preferences.stopDetection) ?? true;
|
||||
});
|
||||
}
|
||||
|
|
@ -171,6 +173,15 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
setState(() => buffering = value);
|
||||
},
|
||||
),
|
||||
if (advanced && Platform.isAndroid)
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.wakelockLabel),
|
||||
value: wakelock,
|
||||
onChanged: (value) async {
|
||||
await Preferences.instance.setBool(Preferences.wakelock, value);
|
||||
setState(() => wakelock = value);
|
||||
},
|
||||
),
|
||||
if (advanced)
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.stopDetectionLabel),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue