updateState method

void updateState(
  1. UpgraderState newState, {
  2. bool updateTheVersionInfo = false,
})

Updates the Upgrader state, which updates the stream, which triggers a call to shouldDisplayUpgrade.

Implementation

void updateState(UpgraderState newState,
    {bool updateTheVersionInfo = false}) {
  _state = newState;

  if (updateTheVersionInfo) {
    Future.delayed(Duration.zero).then((value) async {
      await updateVersionInfo();
    });
    return;
  }
  updateStream();
}