Skip to content
Blog

Product updates 3 min read

Flutter add-to-app modules now get their own release version

Your Flutter add-to-app module now has its own release version, separate from the host app's. Release it once, and any host app that embeds that build gets the patch, whatever version the host is on.

Abhishek Doshi

Developer Relations Engineer

With add-to-app, your Flutter code is a module and the native Android or iOS app pulls it in like a library.

That caused a snag. Devices reported the host app’s version, and the host app ships on its own schedule, so every new host version needed a new module release before its users got patches.

Now the module has its own release version. Run shorebird release aar for Android or shorebird release ios-framework for iOS, once. Any host app that embeds that build gets the patch, whatever version the host is on. You need a recent Shorebird CLI and Flutter.

Why a module needs its own release version

A Shorebird patch targets a release. For a normal Flutter app, that’s just the app’s version.

A module is different. The host team can bump their version or ship a hotfix and never touch your Flutter code. If patches were tied to the host version, you’d have to cut a new module release for every one of those builds before anyone got a patch.

So the module gets its own version. You pick it when you release, and devices report it whichever host build they’re on.

You’ll need Shorebird 1.6.142 or newer (for releasing and patching) and Flutter 3.47.9 or newer. shorebird upgrade updates the CLI.

What a patch can and can’t change in a module

A patch swaps the module’s compiled Dart code, nothing else. A bug in a Flutter screen or an API call? A patch fixes it.

Native code is out. That means the native side of a platform channel, and any new plugin that brings its own native code. Images and fonts too, since patches don’t touch assets.

For those you need a new module release and a new host app build, so if some logic might need a hotfix later, keep it in Dart.

Several host apps, several host versions, one patch

Say two host apps embed your module, and each has three versions live in the stores. If they all embed the same module build, that’s one release and one patch, not six.

The patch belongs to the module release, not to a host app. A host gets it once it ships that module build. Hosts still on an older build stay on that build’s release, so if the bug is in both builds, you patch both releases.

Everyone on a release gets its patch, and rollbacks work the same way. You can’t pick patches per host app. If you want one host to try a patch first, use a track. How to release and patch a Flutter add-to-app module walks through it.

For the rest, see the Module versions guide.

Try it on your next module release

If you embed Flutter in a native app, the module now gets its own release version, separate from the host app’s. Run shorebird upgrade, then read the Module versions guide.

The commands are in part 2, How to release and patch a Flutter add-to-app module. It also covers checking a patch in device logs, tracks and QA builds, and what to do if your module was built on an older version.

Something look off? Tell us on Discord.

All posts
  • Product updates 2 min read

    Stream Shorebird events to your webhooks

    Shorebird now sends signed OCSF events to your webhooks, including release, patch, and track events. Enterprises also get governance audit events.

    Wesley Peck

    Lead Product Manager

  • Product updates 4 min read

    Roll out patches to a percentage of your users

    Send a patch to some of your users first, raise the percentage when you're happy with it, and roll it back if something's wrong. No app changes needed.

    Abhishek Doshi

    Developer Relations Engineer

  • Product updates 3 min read

    OIDC sign-in for service accounts

    Shorebird service accounts can now sign in from GitHub Actions with OIDC, so CI runs releases and patches without a stored SHOREBIRD_TOKEN to rotate.

    Wesley Peck

    Lead Product Manager

Ship your first patch today.

Install the CLI, create a release and send a patch. Free for 5,000 patch installs a month.

Larger team? Talk to sales