needUpdate method

bool needUpdate()

Implementation

bool needUpdate() {
  if (_status == CircleLockStatus.invalid) {
    return false;
  } else if (_status == CircleLockStatus.active) {
    return true;
  } else if (_status == CircleLockStatus.pending) {
    if (_timeSincePending == _timeSinceUpdateLoop) return false;

    var nowTime = DateTime.now().millisecondsSinceEpoch;
    if (nowTime - _timeSincePending < minDuration) {
      return nowTime - _timeSinceUpdateLoop > maxDuration;
    } else {
      return true;
    }
  }
  return false;
}