I feel like the other answers are dancing around your issue.
You want your upgraded changes to reflect inside pubspec.yaml then use --tighten.
From dart pub upgrade --help:
--tighten              Updates lower bounds in pubspec.yaml to match the resolved version.