Open provokateurin opened 3 years ago
Can you submit a PR on the plugin repo removing the plugins that don't need specific platform implementation ?
I'm not sure if that is the best way, because it will break apps. Is there a possibility we can show a warning when one of those plugins is used and after a while we remove it completely?
Yea, by creating new versions: https://github.com/go-flutter-desktop/plugins/releases And modifying:
https://github.com/go-flutter-desktop/plugins/blob/a4e7164360e07c729802ff2dec6be484eb1de4cd/shared_preferences/import.go.tmpl#L10-L16
But that would only apply to people who install the plugin the first time, after that the template file won't be updated, right? I think printing the warning at runtime is a better option, because it will warn everyone regardless of their setup.
I did it that way, but maybe I'm wrong? Anyway the solution should work
Be aware that the mechanism by which you are automatically picking up the Dart implementations is temporary. Once that's resolved, you'll get the the method channel implementation by default again unless you implement auto-registration of Dart plugins.
Some plugins like
shared_preferences
have been implemented in pure dart: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux. We should deprecate those plugins (and all other plugins that are now available this way) in the plugins repository, because it causes a lot of confusion why an app can still remember something while the data has been cleared (happened to me twice). Also we should maybe promote all plugins that are implemented in pure dart in the readme of the repository, because they also work for us and maybe there are even some that haven't been implemented by us yet.EDIT:
url_launcher
isn't implemented in pure dart.