AutoUpdaterStandaloneUI class

UI callbacks for the standalone auto-updater.

All callbacks are optional. If not provided, the corresponding UI will not be shown (silent mode).

Example with Flutter's built-in dialogs:

AutoUpdaterStandaloneUI(
  onShowUpdateAvailable: (context, info, onDownload) {
    showDialog(
      context: context!,
      builder: (ctx) => AlertDialog(
        title: Text('Update Available'),
        content: Text('Version ${info.displayVersion} is available'),
        actions: [
          TextButton(onPressed: () => Navigator.pop(ctx), child: Text('Later')),
          ElevatedButton(
            onPressed: () {
              Navigator.pop(ctx);
              onDownload();
            },
            child: Text('Update'),
          ),
        ],
      ),
    );
  },
)

Constructors

AutoUpdaterStandaloneUI({void onShowDisabledMessage(BuildContext? context)?, void onShowNoUpdateMessage(BuildContext? context)?, void onShowError(BuildContext? context, String title, String message)?, void onShowUpdateAvailable(BuildContext? context, VersionInfo info, VoidCallback onDownload)?, Future<bool> onShowPermissionDialog(BuildContext? context)?, void onShowPermissionDenied(BuildContext? context)?, void onShowManualInstallRequired(BuildContext? context, String filePath)?, VoidCallback? onShowDownloadProgress(BuildContext? context, ValueNotifier<double> progress, ValueNotifier<String> status, ValueNotifier<bool> isDownloading)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onShowDisabledMessage → void Function(BuildContext? context)?
Called when updates are disabled
final
onShowDownloadProgress VoidCallback? Function(BuildContext? context, ValueNotifier<double> progress, ValueNotifier<String> status, ValueNotifier<bool> isDownloading)?
Called to show download progress. Returns a callback to dismiss the progress UI.
final
onShowError → void Function(BuildContext? context, String title, String message)?
Called when an error occurs
final
onShowManualInstallRequired → void Function(BuildContext? context, String filePath)?
Called when manual installation is required
final
onShowNoUpdateMessage → void Function(BuildContext? context)?
Called when no update is available
final
onShowPermissionDenied → void Function(BuildContext? context)?
Called when permission is denied
final
onShowPermissionDialog Future<bool> Function(BuildContext? context)?
Called to show permission dialog. Return true to proceed with permission request.
final
onShowUpdateAvailable → void Function(BuildContext? context, VersionInfo info, VoidCallback onDownload)?
Called when an update is available. onDownload should be called to start the download.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited