Fix type cast error in location util

This commit is contained in:
estevez-dev
2020-07-08 10:54:41 +03:00
parent 819dfc725d
commit e5fe853f0b
3 changed files with 7 additions and 4 deletions

View File

@ -97,10 +97,13 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
}
_switchLocationTrackingState(bool state) async {
await AppSettings().save({'location-updates-interval': _locationInterval.inSeconds, 'location-updates-priority': _accuracy, 'location-updates-show-notification': _showNotification});
if (state) {
try {
await platform.invokeMethod('startLocationService');
await platform.invokeMethod('startLocationService', <String, dynamic>{
'location-updates-interval': _locationInterval.inSeconds,
'location-updates-priority': _accuracy,
'location-updates-show-notification': _showNotification
});
} catch (e) {
_locationTrackingEnabled = false;
}