start method
Future<void>
start(
{ - bool watchReleases = false,
})
Implementation
Future<void> start({bool watchReleases = false}) async {
if (_disposed) return;
if (_started) {
if (watchReleases) {
_persistentReleaseWatch = true;
_ensureReleaseSubscription();
}
return;
}
_started = true;
_persistentReleaseWatch = watchReleases;
WidgetsBinding.instance.addObserver(this);
if (installationEnabled) await _restoreInstalledVersion();
if (_disposed) return;
_progressSubscription = installer.progress.listen((progress) {
if (!_installOperationActive) return;
_setState(
_state.copyWith(
status: progress >= 1
? NAppUpdateStatus.verifying
: NAppUpdateStatus.downloading,
progress: progress,
),
);
});
await checkNow();
if (_persistentReleaseWatch || _releaseWatchers > 0) {
_ensureReleaseSubscription();
}
}