FlutterOTA class

Main entry-point for the Flutter OTA SDK.

Usage:

await FlutterOTA.initialize(appId: 'your-app-uuid', channel: 'stable');
final response = await FlutterOTA.checkForUpdate();
if (response.hasUpdate) {
  await FlutterOTA.applyUpdate(response.release!);
}

Properties

hashCode int
The hash code for this object.
no setterinherited
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

Static Properties

statusNotifier ValueNotifier<UpdateStatus>
Observable update status stream.
final

Static Methods

applyUpdate(OTARelease release) Future<void>
Download and apply an OTARelease.
checkForUpdate() Future<UpdateCheckResponse>
Check whether an update is available for this device.
clearPendingBundle() Future<void>
Clear the pending bundle state (call after successfully loading it).
getActiveBundlePath() Future<String?>
Returns the active OTA bundle path selected by the native bootstrap.
getActiveVersion() Future<String?>
Returns the active OTA version selected by the native bootstrap.
getActiveVersionCode() Future<int?>
Returns the active OTA versionCode selected by the native bootstrap.
getPendingBundlePath() Future<String?>
Returns the locally-pending bundle path if one is waiting to be loaded, null otherwise.
getPendingVersion() Future<String?>
Returns the staged OTA version waiting to be loaded on next startup.
getPendingVersionCode() Future<int?>
Returns the staged OTA versionCode waiting to be loaded on next startup.
initialize({required String appId, String channel = 'stable', String? baseUrl}) Future<void>
Initialize the SDK. Must be called before any other method.