dartpluginsfederated-learning

Using dart pigeon in a federated model


I"m looking at converting a dart package (https://pub.dev/packages/sounds) to a federated model using pigeon.

The documentation around combing these two pieces is a little sparse.

Looking at the video_player sample (https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_platform_interface) seems to suggest a federated model as the web platform is separate.

However both the android and ios packages are part of the main package.

Is this just an historical artefact or do the ios and android packages still need to be part of the main plugin?

If they can be separated out what is the correct package(s) structure?

Are then any open source plugins that use pigeon in a fully federated model that could be used as samples?


Solution

  • Having the iOS and Android projects inside of the main package is the standard as of now. I looks like there's discussion around generating federated plugins when running flutter create.

    There is an article on the url_launcher federated plugin model refactor which is helpful for figuring out the FS structure:

    https://medium.com/flutter/how-to-write-a-flutter-web-plugin-part-2-afdddb69ece6

    https://github.com/flutter/plugins/tree/master/packages/url_launcher

    As far as Pigeon is concerned, because Pigeon is in pre-release and the federated plugin design is fairly new, I doubt there are any fully federated open source packages using Pigeon. However it seems like your message spec would be owned by the my_plugin_platform_interface package and the generated code would be copied over to your platform specific package e.g. my_plugin_ios, my_plugin_android, my_plugin_macos, etc.

    Hope that's of some use.