我想将我在 Flutter 2.0 上的项目升级到最新版本的 Flutter (2.5)。
我已经看到了这个最相关的问题。 如何升级现有的 Flutter 应用程序?
在我的 Mac 中,我已将 Flutter 升级到 2.5。你可以看到flutter doctor -v
下面的输出:
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.5.2 20G95 darwin-arm, locale
en-PK)
• Flutter version 2.5.0 at /Users/ahmad/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (9 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/ahmad/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.11.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 57868E1C-4871-4185-A797-383121736AB8 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 93.0.4577.82
• No issues found!
我已经在互联网上搜索过它。大多数情况下,我看到两件事,如何升级到 null-safety(即从早期版本升级到 2.0)或如何升级系统中的 Flutter sdk。
我试过运行flutter upgrade
命令说我是最新的。我也试过跑步flutter pub upgrade
。两者都不会更改pubspec.lock
我项目内文件中的颤振版本,文件末尾会显示:
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.0"
请指导我如何将我的项目升级到最新版本。提前致谢 :)