Desdaemon / flutter_rust_bridge_template

Template for Flutter + Rust integration with flutter_rust_bridge.
https://desdaemon.github.io/flutter_rust_bridge_template/
Apache License 2.0
120 stars 63 forks source link

What about plugins ? #22

Closed Pierre-Monier closed 1 year ago

Pierre-Monier commented 1 year ago

Hi, this template is really cool and save us a lot of time.

I'm currently trying to turn a project, made with this template, into a dart:ffi plugin. Is there any guide or documentation or tips to do it ? This looks like a lot of tricky configurations to do, and I'm kind of lost.

Also, I think that it would be just perfect to have a plugin template out of the box

Desdaemon commented 1 year ago

Thank you for your kind words! There was some interest a few months ago on making a FFI plugin template, sadly I've not had time to follow up on this. I also haven't been using Flutter recently, but otherwise would be glad to review PRs either on this repo or the codegen's.

Pierre-Monier commented 1 year ago

Ok I see, I will work on creating a ffi plugin template. Maybe I can also update the docs on the codegen package if I got interesting things to add

Pierre-Monier commented 1 year ago

I think I will start from the macos-static branch, because it's what works on macos for me.

Is there a reason to not merge this branch into master ?

Desdaemon commented 1 year ago

I think I will start from the macos-static branch, because it's what works on macos for me.

Is there a reason to not merge this branch into master ?

Not much, other than that I (or someone else) will have to update the documentation to match.

Pierre-Monier commented 1 year ago

I made this branch on my forked version of this repo. This is a v1 template for plugin development, currently works on android/ios/macos.

Should I push in this repo on a specific plugin branch ? Or should I keep it on my side and rename it "flutter_rust_bridge_plugin_template" ? Not sure what's best

Desdaemon commented 1 year ago

Looks great! Could you create a PR against the plugin branch? I'll update the documentation to point to it.

Pierre-Monier commented 1 year ago

Also, here is a plugin make with the plugin template

Note that currently the ios/macos libraries are way too big and can't be published on pub.dev

Desdaemon commented 1 year ago

Note that currently the ios/macos libraries are way too big and can't be published on pub.dev

This was also mentioned in part in the original issue as well. Perhaps we can leave it as a possible future contribution, and put in some documentation on this limitation and possible workarounds.

Pierre-Monier commented 1 year ago

I manage to fit my plugins to pass it under the pub.dev size limit. Basically, the tip is to use dynamic libraries whenever it's possible. I will update the template soon

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.