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
How should plugin developers manage the migration to Flutter 3? #103583
Comments
Thanks for the report. Keeping it open for further insights from the team. |
Related: #103561 |
in flutter/website#7128 i add the _ambiguate suggestion to the release notes |
People updating Flutter constraints to 3.0.0 wouldn't create the kind of problem the NNBD transition did, because updating the minimum Flutter version isn't a breaking change. Someone can adopt Flutter 3 for their app with an arbitrary combination of plugins that require 3.0, plugins that support older versions with something like The Flutter 2/NNBD transition was a very unusual case caused by needing to ripple breaking version changes, which must be explicitly adopted and which conflict with un-migrated dependency trees, across essentially the entire ecosystem. |
I think there is still an issue here. Because plugins do not include a maximum constraint on Flutter, that is implicitly saying that a plugin will continue to work on every future version of Flutter. This change to nullability in Flutter 3 fortunately only generates compiler warnings and not errors, but in theory, new Flutter versions could introduce API changes that also generate compiler errors. So why aren't plugins placing a maximum constraint on the Flutter version? Reading the Flutter compatibility policy, there is also no indication that semantic versioning is being used to indicate breaking changes, which would make it very difficult to actually know what the correct maximum constraint should be. If these constraints were all made explicit, the migration advice might suggest not only using |
Because as you say, we give:
In fact, we don't use semantic versioning for Flutter at all, because every release has breaking changes, so it would be somewhat pointless. There's really no way to know what the maximum version should be. |
Related #95472 (TL;DR there is currently no way to constrain a maximum Flutter version, by design) |
See also #96282 which highlights some of the reasons semver wouldn't work well for Flutter. (Also note that if we did use semver, and package authors did set constraints, the effect would be that every single Flutter package would stop working every time Flutter were updated, and they would all have to be updated by their authors every time. And running pretty much anything on master would be impossible. It would be a lot worse than the current situation.) |
I'm going to close this; flutter/website#7128 documented the specific issue requested the issue was about (how libraries can handle this specific change in Flutter 3.0). And as discussed above, the secondary question of maximum Flutter versions is intentionally the way it is; any further discussion there would belong in #96282. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Flutter 3 introduces nullability changes to WidgetsBinding but plugins (including the first class plugins) have been using a version spec like this:
The first issue is that I assume that Flutter 3 could in theory introduce breaking changes because it is a major version bump, yet the constraint
>=2.10.0
doesn't guard against that.But the second issue is that if a plugin migrates to Flutter 3 and uses the new nullability on WidgetsBinding, and sets a minimum Flutter version constraint to ">=3.0.0", then we are likely to have a similar situation to the Flutter 2 migration with many plugins lagging behind in the migration process blocking the adoption of Flutter 3.
What is the official advice on how to manage the Flutter 3 migration process?
The video_player plugin has a workaround in the form of:
This technique could be helpful to include in the official migration advice.
The text was updated successfully, but these errors were encountered: