简体   繁体   English

VScode是否需要更新Dart SDK?

[英]Is it required to update Dart SDK for VScode?

When I check dart and flutter version from VScode it shows当我从 VScode 检查 dart 和 flutter 版本时,它显示

Dart VM version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "windows_x64" Dart VM 版本:“windows_x64”上的 2.7.0(2019 年 12 月 6 日星期五 16:26:51 +0100)

Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision adc687823a (12 days ago) • 2021-04-16 09:40:20 -0700 Engine • revision b09f014e96 Tools • Dart 2.12.3 Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision adc687823a (12 days ago) • 2021-04-16 09:40:20 -0700 Engine • revision b09f014e96 Tools • Dart 2.12.3

But when I run VScode it prompts me to update Dart SDK但是当我运行 VScode 时,它会提示我更新 Dart SDK

Version 2.12.4 of the Dart SDK is available (you have 2.7.0). Dart SDK 版本 2.12.4 可用(您有 2.7.0)。 Some features of Dart Code may not work correctly with an old SDK. Dart 代码的某些功能可能无法与旧的 SDK 一起正常工作。

At the same time the dart sdk page says同时dart sdk页面说

As of Flutter 1.21, the Flutter SDK includes the full Dart SDK. As of Flutter 1.21, the Flutter SDK includes the full Dart SDK. So if you have Flutter installed, you might not need to explicitly download the Dart SDK.因此,如果您安装了 Flutter,您可能不需要显式下载 Dart SDK。 Consider downloading the Dart SDK if any of the following are true:如果以下任何一项为真,请考虑下载 Dart SDK:

  • You don't use Flutter.您不使用 Flutter。
  • You use a pre-1.21 version of Flutter.您使用的是 Flutter 的 1.21 之前的版本。
  • You want to reduce disk space requirements or download time, and your use case doesn't require Flutter.您想减少磁盘空间要求或下载时间,而您的用例不需要 Flutter。 For example, you might have a continuous integration (CI) setup that requires Dart but not Flutter.例如,您可能有一个需要 Dart 但不需要 Flutter 的持续集成 (CI) 设置。

So should I update dart sdk?那么我应该更新 dart sdk 吗? But as it says if you have Flutter installed, you might not need to explicitly download the Dart SDK , it' a litle bit confused., because I have Flutter installed. But as it says if you have Flutter installed, you might not need to explicitly download the Dart SDK , it' a litle bit confused., because I have Flutter installed.

You no longer need to download a separate dart SDK.您不再需要单独下载 dart SDK。 Remove it (at least move it out of the way), and do flutter upgrade .将其移除(至少将其移开),然后执行flutter upgrade If "dart --version" still works, you're golden, although you may need to remove any manually-set dart SDK paths.如果“dart --version”仍然有效,那么您就很成功了,尽管您可能需要删除任何手动设置的 dart SDK 路径。 I'm pretty sure all the supported IDE extensions for Dart pick up the proper "buried within flutter" paths for the Dart SDK. I'm pretty sure all the supported IDE extensions for Dart pick up the proper "buried within flutter" paths for the Dart SDK.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM