checkForUpdates static method
Manually check for updates.
Shows UI feedback (dialogs/snackbars) for the result. Call this from your settings screen's "Check for updates" button.
Example:
ElevatedButton(
onPressed: () => AutoUpdater.checkForUpdates(),
child: Text('Check for Updates'),
)
Implementation
static Future<void> checkForUpdates() async {
if (_instance == null) {
debugPrint('[AutoUpdater] Not initialized. Call init() first.');
return;
}
if (_navigatorKey.currentState == null) {
debugPrint('[AutoUpdater] Navigator not ready. Make sure navigatorKey is attached to MaterialApp.');
return;
}
await _instance!.checkForUpdate(silent: false);
}