-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
From the flutter docs: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins
Federated plugins are a a way of splitting support for different platforms into separate packages. So, a federated plugin can use one package for iOS, another for Android, another for web, and yet another for a car (as an example of an IoT device). Among other benefits, this approach allows a domain expert to extend an existing plugin to work for the platform they know best.
This seems at odds with the official plugins not having the Android and iOS implementations in separate projects.
Looking at shared_preferences as an example: https://github.com/flutter/plugins/tree/master/packages/shared_preferences
Why are web and desktop in separate packages but Android and iOS are not? If we want to swap the implementation of Android or iOS, the default implementation is still present. Why are they special?
Proposal
Treat all platforms the same, 1 package per platform.
Here is an example of what I am calling "fully federated", where there is no platform implementations in the app facing package: https://github.com/MisterJimson/federated_plugins_example/tree/fully-federated