Remove and disable elasticity
This commit is contained in:
parent
e243aacde7
commit
57a38d964f
2 changed files with 2 additions and 16 deletions
|
|
@ -16,7 +16,6 @@ class Preferences {
|
||||||
static const String heartbeat = 'heartbeat';
|
static const String heartbeat = 'heartbeat';
|
||||||
static const String buffer = 'buffer';
|
static const String buffer = 'buffer';
|
||||||
static const String preventSuspend = 'prevent_suspend';
|
static const String preventSuspend = 'prevent_suspend';
|
||||||
static const String disableElasticity = 'disable_elasticity';
|
|
||||||
static const String stopDetection = 'stop_detection';
|
static const String stopDetection = 'stop_detection';
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
|
|
@ -26,8 +25,7 @@ class Preferences {
|
||||||
: SharedPreferencesOptions(),
|
: SharedPreferencesOptions(),
|
||||||
cacheOptions: SharedPreferencesWithCacheOptions(
|
cacheOptions: SharedPreferencesWithCacheOptions(
|
||||||
allowList: {
|
allowList: {
|
||||||
id, url, accuracy, interval, distance, buffer, heartbeat,
|
id, url, accuracy, interval, distance, buffer, heartbeat, preventSuspend, stopDetection,
|
||||||
preventSuspend, disableElasticity, stopDetection,
|
|
||||||
'device_id_preference', 'server_url_preference', 'accuracy_preference',
|
'device_id_preference', 'server_url_preference', 'accuracy_preference',
|
||||||
'frequency_preference', 'distance_preference', 'buffer_preference',
|
'frequency_preference', 'distance_preference', 'buffer_preference',
|
||||||
},
|
},
|
||||||
|
|
@ -78,7 +76,7 @@ class Preferences {
|
||||||
locationTemplate: _locationTemplate(),
|
locationTemplate: _locationTemplate(),
|
||||||
showsBackgroundLocationIndicator: false,
|
showsBackgroundLocationIndicator: false,
|
||||||
preventSuspend: instance.getBool(preventSuspend),
|
preventSuspend: instance.getBool(preventSuspend),
|
||||||
disableElasticity: instance.getBool(disableElasticity),
|
disableElasticity: true,
|
||||||
disableStopDetection: instance.getBool(stopDetection) == false,
|
disableStopDetection: instance.getBool(stopDetection) == false,
|
||||||
pausesLocationUpdatesAutomatically: instance.getBool(stopDetection) == false,
|
pausesLocationUpdatesAutomatically: instance.getBool(stopDetection) == false,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ class SettingsScreen extends StatefulWidget {
|
||||||
class _SettingsScreenState extends State<SettingsScreen> {
|
class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
bool buffering = true;
|
bool buffering = true;
|
||||||
bool preventSuspend = false;
|
bool preventSuspend = false;
|
||||||
bool disableElasticity = false;
|
|
||||||
bool stopDetection = false;
|
bool stopDetection = false;
|
||||||
bool advanced = false;
|
bool advanced = false;
|
||||||
|
|
||||||
|
|
@ -31,7 +30,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
setState(() {
|
setState(() {
|
||||||
buffering = Preferences.instance.getBool(Preferences.buffer) ?? true;
|
buffering = Preferences.instance.getBool(Preferences.buffer) ?? true;
|
||||||
preventSuspend = Preferences.instance.getBool(Preferences.preventSuspend) ?? false;
|
preventSuspend = Preferences.instance.getBool(Preferences.preventSuspend) ?? false;
|
||||||
disableElasticity = Preferences.instance.getBool(Preferences.disableElasticity) ?? false;
|
|
||||||
stopDetection = Preferences.instance.getBool(Preferences.stopDetection) ?? true;
|
stopDetection = Preferences.instance.getBool(Preferences.stopDetection) ?? true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -160,16 +158,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
setState(() => buffering = value);
|
setState(() => buffering = value);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (advanced)
|
|
||||||
SwitchListTile(
|
|
||||||
title: Text(AppLocalizations.of(context)!.disableElasticityLabel),
|
|
||||||
value: disableElasticity,
|
|
||||||
onChanged: (value) async {
|
|
||||||
await Preferences.instance.setBool(Preferences.disableElasticity, value);
|
|
||||||
await bg.BackgroundGeolocation.setConfig(Preferences.geolocationConfig());
|
|
||||||
setState(() => disableElasticity = value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (advanced)
|
if (advanced)
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
title: Text(AppLocalizations.of(context)!.stopDetectionLabel),
|
title: Text(AppLocalizations.of(context)!.stopDetectionLabel),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue