Prompt to run "pub upgrade" upon opening a package if the SDK versions has changed
See original GitHub issueWhen the user upgrades their SDK (a major or minor change, but not patch) there may be new versions of packages that were not available before (or that are required for some classes of changes). We should detect this change when we’re checking if they need to run “pub get” (we can get the last version used to fetch packages from .dart_tool/package_config.json
: ("generatorVersion": "2.19.0-374.0.dev"
)) and offer to run pub upgrade
(in preference to pub get
).
@devoncarew should we do this in both directions, or only one? It probably doesn’t affect many users, but I realise that I often switch between SDK versions (for testing) and if I click pub upgrade
on this prompt and then switch back to an older SDK, there’s a possibility that I now have packages that are not valid. Would pub upgrade
even fix this (I don’t thinkpub downgrade
is what’s wanted here, because I want to go back to “the highest that is valid given this new (lower) SDK”?)
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Yeah, the other one said “Get packages”. I’ve changed them to
run 'pub get'
andrun 'pub upgrade'
(I left offdart
to be shorter and avoid confusion withflutter
and this prompt may apply to multiple projects in the workspace), looks like this now (I changed “upgrade” to “updated” in the text as I think it reads a little better too, but happy to tweak):Ah, I hadn’t considered that that would fix it, that makes sense. So where today it’s:
I think we probably want:
?