update method

void update(
  1. int value
)

Updates the RankGenerator with the current progress value.

If the progress value changes and the rank hasn't been granted, it increments the current rank, checks the threshold, and triggers the listener if necessary.

Implementation

void update(int value) {
  if (value != _temp && !_granted) {
    _temp = value;
    _current = _current + _increment;
    if (_grantMode) {
      _granted = true;
      _generate?.call(_current);
    }
  }
}