In your app
Client API
Observe progress and control update checks.
Add the package
flutter pub add 'otadart:{"hosted":"https://otadart.dev/pub"}'otadart init does this for you.
Attach to a compatible release
Initialize with the unique app ID generated by your workspace. In a compatible preview build, the runtime supplies public release configuration and a stable installation ID. No account API secret is needed.
final client = await OtaDart.initialize(
appId: 'YOUR-GENERATED-APP-ID',
);Note: An optional publicKey argument checks the bundled raw base64 verification key. This initializer requires the compatible native bootstrap; it does not add production OTA support to an ordinary Flutter build.
Check and observe
final subscription = client.progress.listen((progress) {
// Show the phase or download progress in your own UI.
});
final result = await client.checkForUpdate();
final state = await client.status();Repeated concurrent checks share the current operation. The client stages updates for a later process launch. Use the progress stream for checking, downloading, verification, staging and error states.
Confirm a working launch
await client.markCurrentBootHealthy();
// On disposal:
await subscription.cancel();
await client.close();Call the health acknowledgement after the application has reached the state you consider healthy. Do not acknowledge immediately just to dismiss a pending boot.