fluxota_sdk 0.1.0-dev.4
fluxota_sdk: ^0.1.0-dev.4 copied to clipboard
Signed Dart over-the-air updates for Android Flutter apps, with startup health checks and automatic recovery.
example/fluxota_sdk_example.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:fluxota_sdk/fluxota_sdk.dart';
// First configure the Android host/public roots with the Fluxota CLI and build
// a release reference. This Dart example alone does not provision that setup.
void main() {
final binding = WidgetsFlutterBinding.ensureInitialized();
final updater = FluxotaUpdater();
runApp(const MaterialApp(home: FluxotaExample()));
unawaited(_checkAfterStartup(binding, updater));
}
Future<void> _checkAfterStartup(
WidgetsBinding binding,
FluxotaUpdater updater,
) async {
await binding.waitUntilFirstFrameRasterized;
try {
// Run any additional application-specific health checks before this call.
await updater.markHealthy();
await updater.checkForUpdate();
} on FluxotaUpdateException {
// Keep the application usable; schedule a later opportunity to check again.
}
}
class FluxotaExample extends StatelessWidget {
const FluxotaExample({super.key});
@override
Widget build(BuildContext context) => const Scaffold(
body: Center(child: Text('Fluxota Android developer pilot')),
);
}