A Flutter package for receiving over-the-air (OTA) updates from a QuickPatch server.
Add to your pubspec.yaml:
dependencies:
quickpatch_code_push: ^1.0.0Or run:
flutter pub add quickpatch_code_pushimport 'package:quickpatch_code_push/quickpatch_code_push.dart';
final _updater = QuickPatchUpdater();
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Check for update in the background — non-blocking
_updater.checkForUpdate().then((status) {
if (status == UpdateStatus.outdated) {
_updater.update();
}
});
runApp(const MyApp());
}| Method | Description |
|---|---|
isAvailable |
Whether the updater is available (requires a QuickPatch release build) |
checkForUpdate({track}) |
Check if a new patch is available. Returns UpdateStatus |
update({track}) |
Download and install the latest patch |
readCurrentPatch() |
Get the currently active patch number |
readNextPatch() |
Get the next patch staged for install |
// Check stable (default)
final status = await _updater.checkForUpdate();
// Check a specific track
final status = await _updater.checkForUpdate(track: UpdateTrack.beta);
final status = await _updater.checkForUpdate(track: UpdateTrack('internal'));- App must be built with
quickpatch release android/quickpatch release ios quickpatch.yamlmust be present at the project root with yourapp_idandbase_url
- QuickPatch CLI & installers —
quickpatch init / release / patch - Configure your app's
app_idandbase_urlinquickpatch.yaml(written byquickpatch init).