shorebird_code_push 0.1.3 copy "shorebird_code_push: ^0.1.3" to clipboard
shorebird_code_push: ^0.1.3 copied to clipboard

Check for and download Shorebird code push updates from your app.

Shorebird Code Push #

License: MIT

A Dart library that allows Flutter apps to get information about code push updates.

WARNING: This package is in a preview state and does not work with the currently available version of Shorebird.

Usage #

// Import the library
import 'package:shorebird_code_push/shorebird_code_push.dart';

// Create an instance of the ShorebirdCodePush class
final shorebirdCodePush = ShorebirdCodePush();

// Get the current patch version, or null if no patch is installed.
final currentPatchversion = shorebirdCodePush.currentPatchVersion();

// Check whether a patch is available to install.
final isUpdateAvailable = await shorebirdCodePush.isNewPatchAvailableForDownload();

if (isUpdateAvailable) {
  // Download the patch.
  await shorebirdCodePush.downloadUpdate();
}

Developing #

FFI #

The Dart code in this library communicates with the Updater (part of Shorebird's Flutter engine) via FFI.

For an Updater function to be visible to the Dart code, it must:

  1. Be declared in c_api.rs as pub extern "C".
    1. This will add the function to the library/include/updater.h header file, which is generated by cbindgen when the Updater is built.
  2. Be included in the generated ffi bindings. These can be regenerated using dart run ffigen.
  3. Android specific: be listed in https://github.com/shorebirdtech/engine/blob/main/shell/platform/android/android_exports.lst
232
likes
150
pub points
96%
popularity

Publisher

verified publishershorebird.dev

Check for and download Shorebird code push updates from your app.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

ffi, meta

More

Packages that depend on shorebird_code_push