Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate plugins that are implemented by the flutter team in pure dart #583

Open
provokateurin opened this issue Mar 25, 2021 · 6 comments
Labels
enhancement New feature or request plugin Issue about an existing or possible plugin

Comments

@provokateurin
Copy link
Member

provokateurin commented Mar 25, 2021

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.

@provokateurin provokateurin added the enhancement New feature or request label Mar 25, 2021
@pchampio pchampio added the plugin Issue about an existing or possible plugin label Mar 25, 2021
@pchampio
Copy link
Member

Can you submit a PR on the plugin repo removing the plugins that don't need specific platform implementation ?

@provokateurin
Copy link
Member Author

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?

@pchampio
Copy link
Member

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

@provokateurin
Copy link
Member Author

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.

@provokateurin
Copy link
Member Author

I did it that way, but maybe I'm wrong? Anyway the solution should work

@stuartmorgan
Copy link

stuartmorgan commented Mar 25, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin Issue about an existing or possible plugin
Development

No branches or pull requests

3 participants