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

refactor: Lot of code duplication when I use this template #88

Open
1 task
rekire opened this issue Mar 20, 2024 · 0 comments
Open
1 task

refactor: Lot of code duplication when I use this template #88

rekire opened this issue Mar 20, 2024 · 0 comments
Labels
product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. refactor A code change that neither fixes a bug nor add a feature

Comments

@rekire
Copy link

rekire commented Mar 20, 2024

Description
I'm using this template for me flutter plugin and trying to remove boiler plate. I noticed that I have basically the same for each platform the same test and also the same code (just invoking my method channel to let the native code do the hard work).

I noticed that I should be able to use the same MethodChannel{PluginName} for all my platform implementations I had this code:
class {PluginName}Android extends {PluginName}Platform { I replaced it now with class {PluginName}Android extends MethodChannel{PluginName} { and how each platform has basically the same code. For some platforms I really only pass the data via method channel and therefore that class is not required at all. This also applies for the tests. I the differences are just the platform name in the class names.

What do you think about it? Is there not a lot of boiler plate just to make some CI test pass?

Requirements

  • Check if there must be the same code for each platform especially when you just invoke method channels
@rekire rekire added the refactor A code change that neither fixes a bug nor add a feature label Mar 20, 2024
@alestiago alestiago added the product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. refactor A code change that neither fixes a bug nor add a feature
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants