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

[flutter_local_notification_linux] fixed definition and registration of Linux implementation #2371

Merged
merged 3 commits into from
Jul 14, 2024

Conversation

MaikuB
Copy link
Owner

@MaikuB MaikuB commented Jul 14, 2024

Closes #2368

@MaikuB MaikuB merged commit 639a109 into master Jul 14, 2024
12 checks passed
@MaikuB MaikuB deleted the fix-linux-pubspec branch July 14, 2024 02:58
@Gustl22
Copy link

Gustl22 commented Jul 22, 2024

@MaikuB just chiming in and was curious, as it seems removing default_package in pubspec.yaml of flutter_local_notifications for linux seems to be the more proper fix for this, as it doesn't use any native platform code which needs registering. Or did I miss something?

EDIT: Sorry, I missed, that it's handled as a dart only plugin now. But then, the registration shouldn't be handled by the main package anymore:

} else if (defaultTargetPlatform == TargetPlatform.linux) {

@MaikuB
Copy link
Owner Author

MaikuB commented Jul 23, 2024

@Gustl22 agreed though I would more than it doesn't have to be handled by main package than should. This is more because how the plugin is created where from a consumer's point of view, they're constructing an instance of the plugin so it would've been more natural to expect that the Linux implementation is registered then IMO. I hadn't made the changes on the main plugin as it was less urgent that it could be done later (note: I also need to test it out) and AFAIK doesn't cause an issue. The changes I did here were to conform with the expectations that were enforced by the recent changes in Flutter. I am aware though that federated plugin spec documents certain things to be done.

Something this issue does bring to mind though is the message behind the warning should re-evaluated. I saw that you submitted the PR to the Flutter SDK around this. Perhaps something you could look into? I'm not sure how much of an impact this may have on the community on the future

@Gustl22
Copy link

Gustl22 commented Jul 24, 2024

My introduced error message just should make aware, that the package uses a keyword default_package, which has no effect and should be used otherwise and bring up the options. But yes, the error message is kind of misleading, as there can exist packages, but they just don't serve as a native or Dart plugin.
So I added this as proposed by stuartmorgan: flutter/flutter#152134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I was told to ask you to either avoid a reference or create a plugin (I am serious :)
2 participants