I have an existing Flutter app that I built half a year ago. I checked on pubspec.lock
, it has this line:
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.16.0 <2.0.0"
So I assume the app was built for Flutter v1.16.
How do I upgrade this app to use the latest Flutter version? Running "flutter doctor" gives me
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19041.630], locale en-US)
, so my SDK is already updated to the latest version.Interestingly, when I create a new app from scratch, the
pubspec.lock
does not have any information about Flutter's version. The same section now contains only this:sdks: dart: ">=2.10.0-110 <2.11.0"
. In the future, how would I know which version was this app running?
I have tried running "flutter upgrade" within my app, but that was to upgrade the SDK, not the Flutter version of the app. So how do I upgrade my app to use the latest Flutter version? Or is it always built using the latest version of the SDK? Can't I target my app to build with a specific version of Flutter?