Skip to content

letssuhail/quickpatch-flutter

Repository files navigation

quickpatch_code_push

pub package

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.yaml must be present at the project root with your app_id and base_url

Learn more

  • QuickPatch CLI & installersquickpatch init / release / patch
  • Configure your app's app_id and base_url in quickpatch.yaml (written by quickpatch init).

About

Flutter package for QuickPatch OTA code-push updates

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors