quickpatch_code_push 1.0.1
quickpatch_code_push: ^1.0.1 copied to clipboard
Check for and download QuickPatch OTA updates from your Flutter app.
quickpatch_code_push #
A Flutter package for receiving over-the-air (OTA) updates from a QuickPatch server.
Setup #
Add to your pubspec.yaml:
dependencies:
quickpatch_code_push: ^1.0.0
Or run:
flutter pub add quickpatch_code_push
Usage #
import '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());
}
API #
| 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 |
Update tracks #
// 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'));
Requirements #
- App must be built with
quickpatch release android/quickpatch release ios quickpatch.yamlmust be present at the project root with yourapp_idandbase_url
Server #
Self-host your own QuickPatch server: github.com/letssuhail/quickpatch-server