Yukams / background_locator_fixed

A Flutter plugin for updating location in background.
MIT License
50 stars 94 forks source link

Wrong condition for determining the best location #89

Open Erdemtsynduev opened 1 year ago

Erdemtsynduev commented 1 year ago
    //whenever the expected time period is reached invalidate the last known accuracy
    // so that we don't just receive better and better accuracy and eventually risk receiving
    // only minimal locations
    if (location.hasAccuracy()) {
        if (!location.accuracy.isNaN() &&
                location.accuracy != 0.0f &&
                !location.accuracy.isFinite() &&
                !location.accuracy.isInfinite()) {
            overrideLocation = true
        }
    }

Conditions contradict each other !location.accuracy.isFinite() && !location.accuracy.isInfinite()

/**

condition will always be false