r/FlutterDev • • 26d ago

Plugin flutter_patcher 1.0: Open-source, self-hosted code push (Android + iOS) for Flutter using Dart dynamic modules

I just shipped 1.0 of flutter_patcher. It lets you fix bugs in a released Flutter app by shipping a patch instead of a new store release. No account and no backend: patches are static files you host wherever you like. The big one in 1.0: it finally works on iOS too, not just Android.

The day-to-day flow is three commands:

dart run flutter_patcher build <platform>   # release build, saved as baseline
dart run flutter_patcher patch <platform>   # diff fix vs. baseline
dart run flutter_patcher publish            # sign + version

Upload the output to any HTTPS static host (S3/R2 + CDN, nginx…). The app calls FlutterPatcher.checkUpdate(), and the fix applies on the next cold start.

It's built on Dart's dynamic modules. The tooling deals with the custom engine and the build plumbing, so your project stays a normal Flutter project.

What's in 1.0:

- On iOS the patch is Dart bytecode, run by the Dart VM's interpreter. No native machine code is downloaded, which is what makes it work on iOS at all.

- Patches are signed. A device only installs one signed with your keys, built for its exact app version, with a higher number than what it has, so you don't have to trust your CDN.

- If a patch crashes the app on startup, the device drops it and goes back to the installed version on the next launch.

Limitations:

- Flutter 3.47.x only (each Flutter version needs its own engine build)
- Dart code and assets only; native code and plugin changes still need a store release

Would love to hear from anyone who tries it on a real app, bugs or just "this step confused me".

pub.dev: https://pub.dev/packages/flutter_patcher

GitHub: https://github.com/xuelinger2333/flutter_patcher

42 Upvotes

20 comments sorted by

8

u/thelazybeaver10 25d ago

So this is like shorebird?

10

u/Ok-Conversation3386 25d ago

Similar idea, but open source and self-hostable.

3

u/Few-Bug7095 26d ago

Sound promising

2

u/Ok-Conversation3386 25d ago

Thanks! Feedback welcome 🙏

1

u/Few-Bug7095 6d ago

After trying out this package, I think it really is a good start. The things works, but i did feel restricted when I was not able to patch many small ui bugs when using icons specifically, also a lot of things like SingleChildScrollView, CircleAvatar, Card, ListTile i tried and i got some errors i guess its not supported or something, and showDialog, SnackBar also gave me a bit of pain guess its not supported either. The project itself is very promising as I mentioned earlier as well. I tried building a simple dashboard and a tool which would help with automating few processes but i guess its early for now. Best wishes from me, I would love to use it later when we have some stability in it.

1

u/Ok-Conversation3386 1d ago

Thanks for actually trying it out! You're right, it's still pretty early, and that was a real limitation—patches couldn't use widgets that weren't already in the app. Your comment actually pushed me to fix it. Just dropped 1.1.3, so now you can patch in any Flutter widget (Card, ListTile, dialogs, etc.). Let me know what you think if you ever give it another spin.

1

u/Few-Bug7095 1d ago

Great let me try it, and get back to you.

1

u/mateusfccp 24d ago

That's an interesting alternative to Shorebird. Probably not as mature as it yet, but definitely worth taking a look. I hope you succeed.

2

u/Ok-Conversation3386 24d ago

Thanks, appreciate it!

-2

u/inrego 26d ago

I'm pretty sure Apple doesn't allow it, so you won't get your app into App Store. And if you do, you're at risk of suspension any time

8

u/Ok-Conversation3386 25d ago

Apple allows interpreted code as long as you’re not changing what the app does. Patches are Dart bytecode, not native code.

5

u/Due-Setting-2566 25d ago

Shorebird does this for a long time

0

u/aaulia 25d ago

CMIIW, but does shorebird have definitive answer for the Apple App Store questions? Like we're 100% sure we're within the confine of Apple rules and regulations. It's been a while since I last looked at Shorebird.

0

u/infinityMCdx 25d ago

Shorebird cannot be selfhosted. It's not 100% open source either.

3

u/eseidelShorebird 25d ago

That is correct. We're default-open, but not everything we do is open source. And yes, we have no self-hosting support at this time.

1

u/[deleted] 25d ago

[removed] — view removed comment

4

u/Ok-Conversation3386 25d ago

RN OTA is allowed because it’s interpreted, not because it’s Apple’s JS. Same thing here. Just don’t push big features with it.