Remove background check interval setting

You can give android a rough interval for background tasks but it is in
no way guaranteed to be accurate so this setting is getting removed to
avoid confusion.
This commit is contained in:
Nutcake 2023-05-12 18:32:54 +02:00
parent cc81d375e0
commit a9424cc84b
2 changed files with 0 additions and 31 deletions

View file

@ -34,18 +34,15 @@ class SettingsEntry<T> {
class Settings {
final SettingsEntry<bool> notificationsDenied;
final SettingsEntry<int> unreadCheckIntervalMinutes;
final SettingsEntry<int> lastOnlineStatus;
final SettingsEntry<String> lastDismissedVersion;
Settings({
SettingsEntry<bool>? notificationsDenied,
SettingsEntry<int>? unreadCheckIntervalMinutes,
SettingsEntry<int>? lastOnlineStatus,
SettingsEntry<String>? lastDismissedVersion
})
: notificationsDenied = notificationsDenied ?? const SettingsEntry<bool>(deflt: false),
unreadCheckIntervalMinutes = unreadCheckIntervalMinutes ?? const SettingsEntry<int>(deflt: 60),
lastOnlineStatus = lastOnlineStatus ?? SettingsEntry<int>(deflt: OnlineStatus.online.index),
lastDismissedVersion = lastDismissedVersion ?? SettingsEntry<String>(deflt: SemVer.zero().toString())
;
@ -53,7 +50,6 @@ class Settings {
factory Settings.fromMap(Map map) {
return Settings(
notificationsDenied: retrieveEntryOrNull<bool>(map["notificationsDenied"]),
unreadCheckIntervalMinutes: retrieveEntryOrNull<int>(map["unreadCheckIntervalMinutes"]),
lastOnlineStatus: retrieveEntryOrNull<int>(map["lastOnlineStatus"]),
lastDismissedVersion: retrieveEntryOrNull<String>(map["lastDismissedVersion"])
);
@ -71,7 +67,6 @@ class Settings {
Map toMap() {
return {
"notificationsDenied": notificationsDenied.toMap(),
"unreadCheckIntervalMinutes": unreadCheckIntervalMinutes.toMap(),
"lastOnlineStatus": lastOnlineStatus.toMap(),
"lastDismissedVersion": lastDismissedVersion.toMap(),
};
@ -87,7 +82,6 @@ class Settings {
}) {
return Settings(
notificationsDenied: this.notificationsDenied.passThrough(notificationsDenied),
unreadCheckIntervalMinutes: this.unreadCheckIntervalMinutes.passThrough(unreadCheckIntervalMinutes),
lastOnlineStatus: this.lastOnlineStatus.passThrough(lastOnlineStatus),
lastDismissedVersion: this.lastDismissedVersion.passThrough(lastDismissedVersion),
);

View file

@ -5,15 +5,6 @@ import 'package:url_launcher/url_launcher.dart';
class SettingsPage extends StatelessWidget {
const SettingsPage({super.key});
static const Map<int, String> _intervalSelections = {
5: "5 Minutes",
15: "15 Minutes",
30: "30 Minutes",
60: "1 Hour",
120: "2 Hours",
300: "6 Hours",
600: "12 Hours",
};
@override
Widget build(BuildContext context) {
@ -36,22 +27,6 @@ class SettingsPage extends StatelessWidget {
initialState: !sClient.currentSettings.notificationsDenied.valueOrDefault,
onChanged: (value) async => await sClient.changeSettings(sClient.currentSettings.copyWith(notificationsDenied: !value)),
),
ListTile(
trailing: StatefulBuilder(
builder: (context, setState) {
return DropdownButton<int>(
items: _intervalSelections.keys.map((e) => DropdownMenuItem<int>(value: e, child: Text("${_intervalSelections[e]}"))).toList(),
value: sClient.currentSettings.unreadCheckIntervalMinutes.valueOrDefault,
onChanged: (int? value) async {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Sorry, this feature is not yet implemented.")));
await sClient.changeSettings(sClient.currentSettings.copyWith(unreadCheckIntervalMinutes: value));
setState(() {});
},
);
}
),
title: const Text("Check Interval"),
),
const ListSectionHeader(name: "Other"),
ListTile(
trailing: const Icon(Icons.logout),