For instructions on installing the Dart or Flutter extensions, go here.
#4003 v3.42.1 resolves an issue using bleeding-edge Dart/Flutter
master where the language server could fail to start.
Dart: Add Dependency Improvements
#3811: It’s now possible to add multiple dependencies in one step using Dart: Add Dependency using commas between package names.
- #3998: New icons added in Flutter 3.0 (such as
safety_check) now have previews in hovers/completion.
CupertinoIcons.locationno longer shows the wrong icon preview in hovers/completion.
- #3949: A new Flutter task/command (Flutter: Generate Localizations) has been added (including in context menus/title bar for
.arbfiles) that runs
- #3961: Support for initializing the Flutter SDK when installed by a package manager has been generalised to support package managers other than Snap (such as Hermit).
- #3968: The
dart.flutterShowEmulatorssetting now has an additional value
"never"which always hides emulators from device selection picklists.
- #3971/#3965: @nilsreichardt contributed a fix to move the call to
super.dispose()to the end of the
dispose()method in the
stanimsnippet. Note: When snippets are being provided by the language server, the
dispose()call will still be at the start of the method until the next Dart/Flutter SDK releases.
- #3782: Documentation in hovers and code completion can now render basic HTML tags like
- #3989: File nesting patterns have been added to nest several generated files like
foo.dart. File nesting can be enabled using the
explorer.fileNesting.enabledsetting (and default state with the
- #3995: The
dart.flutterHotReloadOnSavesettings have been updated to include new values
"allIfDirty"that will trigger hot-reload-on-save only if the saved file(s) are dirty. The default value remains
"manual"to better support auto-save. The
"always"setting has been renamed to
- #3996: Code Actions that generate code with suggested names (such as Assign value to new local variable) no longer insert snippet markup text into the file.
- #3969: Snippets like
forno longer fail to appear in apps with large dependencies (including Flutter apps).
- #3954: When using Dart 2.17/Flutter 3.0 with LSP disabled, snippets will no longer fail to show up.
- #3946: If a language server request fails, the Output pane will no longer be automatically focused before clicking the “Go to Output” button.
- #3963: Improvements have been made to the recording of test messages that show up in the Test Error Peek window for failed tests. The final failure message should now show up instead of a generic “The test failed” message.
- #3967: Using the
dart.devToolsLogFilesetting to log communication with the DevTools server no longer fails to record any traffic.
Docs / Website
- #3994: Descriptions on the
dart.sdkPathssettings (and equivalent Flutter settings) have been improved tp make it clearer that the
sdkPathssettings are used only for SDK switching and not for initial SDK searching.
- #3824: Docs now contain additional examples for how to configured launch configurations for Dart (non-Flutter) web apps.
Features/Fixes Enabled with Flutter 3.0/Dart 2.17
A number of features/fixes noted from in previous release notes that relied on an updated Dart/Flutter SDK are now available to stable channel users that have upgraded to Flutter 3.0/Dart 2.17, including:
- #3873: Code completion for zero-argument functions no longer places the cursor inside the parens.
- #3872: The Extract Method code action will now check the extraction is valid before prompting for a method name.
- #3869: Some code actions like Surround with if now have improved snippet support and will provide better selections after inserting code.
- #3867: Holding
ctrlwhen hovering over paths to examples in Flutter dartdocs will no longer highlight significantly more of the file than included in the path.
- #3864: “A request has failed” errors will no longer appear if you navigate to files that reference Flutter colors that are outside of the workspace (such as Flutter SDK sources or Pub package sources).
- #3846: The “Convert Getter to Method” assist now works for extensions.
- #3844: Code completion no longer inserts unwanted commas when editing argument names.
- #3823: A new “Convert to ‘package:’ import for everywhere in file” fix is available when using the
- #2492: The “Wrap with Column” refactor is now available when a Widget constructor is selected and not only when there is no selection.
- #3830: The “Invalid file path” message sometimes shown when analysis fails will be more specific rather than a catch-all for several types of failure.
- #3783: Code completion no longer activates while typing in standard double-slash comments that are immediately before a dartdoc triple-slash comment.
- #3778: A new
"instance"semantic token modifier has been added to instance members, allowing them to be themed/colored separately to other symbols.
- #3770: The Create Method ‘xxx’ fix now includes the
requiredkeyword for required named arguments if the library is null-safe.
- #1160: Hover tooltips now include the static type of a variable, which may be different to the declared type (for example if the variable is used in an
- #3784: Code completion should now include members that can be overridden more reliably.
- #3440: New packages added to
pubspec.yamlshould now be available more reliably after saving and waiting for the *
pub getcommand to complete.
- #3438: Fetching packages in a Flutter project should no longer intermittently result in the
flutter_genpackage failing to resolve.
Features/Fixes Enabled with Future SDKs
These items rely on changes to the Dart/Flutter SDKs that have not yet been released to stable channels. They will show up automatically when you update your SDK in future (or if using beta/development channels depending on the exact version).
- #3952: Using
editor.codeActionsOnSaveis no longer very slow (despite the command being very fast when run on its own).
- #3975: Flutter Widget snippets now include
return Container()as a placeholder
- #3981: “Add curly braces” now shows as a Quick-fix for the
- #3970: Ctrl+Click/Go-to-Definition now works on filenames in “part of” directives.
Some feature requests and fixes require new features and fixes in upstream projects like VS Code and LSP which use counts of 👍s on those issues to help gauge demand. The Dart-Code website now lists some of the most significant upstream issues with a description of the feature/fix they would enable. Please consider reviewing this list and adding your 👍 to any GitHub issues relevant to features you’d like to see!