Description
So far, in the prototype phase, we've been able to just always use the latest Flutter version in a given channel (either beta or main). At some point we will want more control, specifying a particular version and being sure everyone gets that version even if it's not the very newest. That way everyone's seeing the same behavior, and a change happening outside our own repo can't break our tests.
In particular, if we use versions from the Flutter main branch, then that will be a constantly moving target. Using the moving target will still be OK as long as we don't frequently see anything change that breaks us, but at some point we'll want to pin the exact version to be sure of that.
Implementation notes
The pubspec.yaml
file lets us specify a lower bound for the Flutter version, but not an upper bound. (The syntax permits an upper bound, but it's ignored.) In particular it doesn't permit specifying an exact version. Upstream discussions:
- [flutter_tools] pubspec.yaml environment.flutter constraint not respected by pub get flutter/flutter#95472 (comment)
- Flutter Wrapper Support. flutter/flutter#26577 (comment)
- It should be possible to pin Flutter Projects to a specific Flutter version flutter/flutter#40428
- dependencies change for flutter depending on channel/minor update? (material_color_utilities added in dev but not stable) flutter/flutter#95807 (comment)
Relatedly, while the flutter
tool provides flutter upgrade
as a handy way to get the latest Flutter version within any given channel (stable, beta, or main), there's no such way to get a specific version. So if Flutter did respect the pubspec.yaml
file as far as complaining when the version was newer than specified, it still wouldn't provide a convenient way to actually get the specified version.
From those upstream threads, it seems like the usual solution in the Flutter community is to use one of several tools people have built to manage Flutter versions. I haven't looked into these in detail yet at all, but listing the ones I've seen mentioned:
So when pursuing this, we'll want to look at those and also look to see if there are other implementations to consider.
Metadata
Assignees
Labels
Type
Projects
Status
No status