Skip to content

Feature for fasten interval #93

@gestef

Description

@gestef
final lastLocation = LocationCache.get();
if (lastLocation == null) return false;

final isHighestAccuracy = Preferences.instance.getString(Preferences.accuracy) == 'highest';
final duration = DateTime.parse(location.timestamp).difference(DateTime.parse(lastLocation.timestamp)).inSeconds;

Important

if (!isHighestAccuracy) {
final fastestInterval = Preferences.instance.getInt(Preferences.fastestInterval);
if (fastestInterval != null && duration < fastestInterval) return true;
}

final distance = _distance(lastLocation, location);

Can change control of Fasteninterval, with its value (0 deactivated), this permit to use High Accuraci and limit the interval as you want
thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions