startPeriodicUpdateChecker method
Starts a Timer with a periodic call to checkForUpdate.
onNewRelease
is called when a new release is available.interval
is the Timer interval. Default: 1min.
Implementation
Timer startPeriodicUpdateChecker(OnRelease onNewRelease,
{Duration? interval, Release? currentRelease}) {
interval ??= Duration(minutes: 1);
return Timer.periodic(interval, (_) async {
var newRelease = await checkForUpdate(
onNewRelease: onNewRelease, currentRelease: currentRelease);
if (newRelease != null) {
currentRelease = newRelease;
}
});
}