chore(deps): update dependency dart to v3#31
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
73fd9be to
871b5f1
Compare
3f35920 to
72fd7a7
Compare
0560be9 to
3c48c4c
Compare
3c48c4c to
323c868
Compare
f4bd63e to
f163578
Compare
f6ba706 to
706afc3
Compare
706afc3 to
15fe1cb
Compare
cd56ae3 to
dab26f3
Compare
3f0c868 to
fd96a0e
Compare
fd96a0e to
9be5e5f
Compare
8bcbc9a to
059f53a
Compare
059f53a to
f1a9682
Compare
f464561 to
f89ae01
Compare
f89ae01 to
a2a2429
Compare
a2a2429 to
da82c0b
Compare
34dd2d9 to
9b571d3
Compare
9b571d3 to
ef4dabe
Compare
ef4dabe to
276ba68
Compare
276ba68 to
4900aa5
Compare
4900aa5 to
f157306
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=2.15.0 <3.0.0→3.12.0Release Notes
dart-lang/sdk (dart)
v3.12.0Compare Source
Released on: Unreleased
Language
Private named parameters
Dart now supports private named parameters. Before 3.12, it was an error to
have a named parameter that starts with an underscore:
This means that, before 3.12, initializing a private field from
a named parameter required an explicit initializer list:
All the initializer list is doing is removing the leading
_.In Dart 3.12, the language does that for you. Now you can write:
This code behaves exactly like the previous example. The initialized fields are
private, but the argument names written at the call site are public:
Libraries
dart:coreRegExpimplementation now supportsmodifier spans and duplicate named capture groups.
dart:js_interopBreaking change in extension name of
isA:isAis moved fromJSAnyUtilityExtensiontoNullableObjectUtilExtensionto supporttype-checking any
Object?.isA<JSObject>()also now handles JS objectswith no prototypes correctly and
isA<JSAny>()does a non-trivial check tomake sure the value is a JS value. See #56905 for more details. As
JSAnyUtilityExtensionis onJSAny?andNullableObjectUtilExtensionis onthe supertype
Object?, this change is only breaking if users referred to theextension name directly, either through applying the extension directly or
through using
show/hidedirectives.isA<JSExportedDartFunction>()now checks whether the function isactually a JS wrapper function that is returned from
Function.toJSorFunction.toJSCaptureThis.Added
JSIterableProtocol,JSIterable,JSIteratorProtocol,JSIterator,and
JSIteratorResulttypes to model JavaScript's iteration protocols.JSArrayandJSStringnow implementJSIterable.Added extension types to provide
Iterable.toJSIterable,JSIterable.toDartIterable,Iterator.toJSIterator, andJSIterator.toDartIterator.Tools
Analyzer
The new
simple_directive_pathslint and its associated fixflag and simplify unnecessarily complex
importandexportpaths,such as those containing redundant
./or backtracking../segments.Use
dart fix --code=simple_directive_paths(with either--dry-runor--apply) to bulk fix existing lint violations.The
prefer_initializing_formalslint rule highlights named parametersthat could be private named parameters.
Use
dart fix --code=prefer_initializing_formals(with either--dry-runor--apply) to bulk fix existing lint violations.Violations of the
avoid_final_parameterslint can now befixed with
dart fix --code=avoid_final_parameters.The analyzer now warns when a function that contains a
parameter annotated with
@mustBeConstis torn off.The
invalid_runtime_check_with_js_interop_typesrule now checks for JSinterop types used in a catch clause's on-type and instructs users to
use
isAfor type checks instead.Analyzer plugins: Initial support for 'print debugging' via new sections in
the "Plugins" Insights (Diagnostics) page. When a plugin is computing lint
and warning diagnostics,
printcalls are now redirected to the analysisserver, which presents the messages in the appropriate plugin's section on
the Plugins page.
Improved support for extension types in many existing lint rules.
Improved support for null-aware elements in existing lint rules.
The analysis server starts up faster with the help of improved analysis
options file caching. The improvement depends on the number of analysis
options files in the workspace, and the number of
included analysis optionsfiles. The improvement is greater for systems with slower disk access.
Various other improvements to analysis performance.
Pub
dart pub cache repairnow, by default, only repairs thepackages referenced by the current project's
pubspec.lockfile.For the old behavior of repairing all packages, use the
--allflag.dart pub addanddart pub unpacknow accept@as an alternative to:for separating a package name from its version constraint.
dart2wasm
deferred modules. The embedder now takes
loadDeferredModulesinstead ofloadDeferredModulewhere the new function should now expect an array ofmodule names rather than individual module names. All the module loading
functions must now also accept an
instantiatorcallback to which theyshould pass the loaded results.
dart2js
JSExportedDartFunction.toDartsometimes incorrectly returned the originalDart function even if the wrapper JS function was cast from a call to the
deprecated
allowInterop. Instead, to be consistent with DDC and dart2wasm,it now throws if the wrapper JS function wasn't a result of
Function.toJSorFunction.toJSCaptureThis.v3.11.6Compare Source
Released on: 2026-05-05
This is a patch release that:
(issue [#63156]).
v3.11.5Compare Source
Released on: 2026-04-15
This is a patch release that:
dart-lang/ai#439)
v3.11.4Compare Source
Released on: 2026-03-24
This is a patch release that:
dot shorthand function expression invocation. (issue dart-lang/sdk#62595)
v3.11.3Compare Source
Released on: 2026-03-17
This is a patch release that:
(issue flutter/devtools#9701).
v3.11.2Compare Source
Released on: 2026-03-10
This is a patch release that:
load lightweight tags (as opposed to annotated tags).
(issue dart-lang/pub#4756).
v3.11.1Compare Source
Released on: 2026-02-24
This is a patch release that:
v3.11.0Compare Source
Released on: 2026-02-11
Language
There are no language changes in this release.
Libraries
dart:ioAF_UNIX) on Windows. Support isrestricted to the subset of features supported by the OS. Windows currently
does not support the following features for
AF_UNIXsockets: datagramsockets, ancillary data or abstract socket addresses. Unix domain sockets are
represented in the file-system using reparse points which leads to some
discrepancies in the behavior of
dart:ioAPIs: for exampleFile(socketPath).existsSync()will returntrueon POSIX operating systems,but
falseon Windows. UseFileSystemEntity.typeSync()instead to getportable behavior.
dart:js_interopJSSymbol, as well asJSSymbol.key,JSSymbol.description, and static methods for all well-known ECMAScriptsymbols.
dart:js_utildart:js_util. Any code that importsdart:js_utilwill no longer compile with dart2wasm. Consequently, code thatdepends on
package:jswill no longer compile with dart2wasm either. The namedart.library.js_utilis no longer a key in dart2wasm compilationenvironments, including in conditional imports and exports.
See #61550 for more details.
Tools
Analyzer
data regarding the "Message Scheduler."
analysis server will now re-use an existing AOT snapshot of the plugins
entrypoint. This saves a constant amount of time at the start of each IDE
session and
dart analyzerun, on the order of 10 seconds.callmethod on a Function object, like "goto definition," and completion.
errorandstackTraceparameters oftry/catch statements.
hovers, quick fixes, assists, "rename" refactoring, and "go to imports."
@DanTup for many of the above enhancements!)
simplify_variable_pattern, which encouragesusing the pattern shorthand for variables and property names of the same
name.
avoid_null_checks_in_equality_operatorslint rule is now deprecated.prefer_final_parameterslint rule is now deprecated.use_if_null_to_convert_nulls_to_boolslint rule is now deprecated.Dart Development Compiler (dartdevc)
Futurereturned bydeferred_prefix.loadLibrary()is now consistent regardless if proper deferred imports are supported in the
runtime environment or not. This makes the timing more consistent with dart2js
where the loads are always an async operation.
Pub
"Glob" support for pub workspaces.
Now to include all packages inside
pkgs/in the workspace, simply write:Supported if the Dart SDK constraint of the containing package is 3.11.0 or
higher.
New command
dart pub cache gcfor reclaiming disk space from your pubcache.
It works by removing packages from your pub cache that are not referenced by
any of your current projects.
New flag
dart pub publish --dry-run --ignore-warningsGiven this flag,
dart pub publish --dry-runwill only exit non-zero if yourproject validation has errors.
dart pub cache repairnow by default only repairs the packages referencedby the current projects pubspec.lock. For the old behavior of repairing all
packages use the
--allflag.v3.10.9Compare Source
Released on: 2026-02-03
This is a patch release that:
libraries with dot shorthands. (issue dart-lang/sdk#62504)
v3.10.8Compare Source
Released on: 2026-01-27
This is a patch release that:
shorthands. (issue dart-lang/sdk#62416)
v3.10.7Compare Source
Released on: 2025-12-23
This is a patch release that:
v3.10.6Compare Source
Released on: 2025-12-16
This is a patch release that:
sublist()implementation on dart2wasm backend.(issue flutter/flutter#179853)
v3.10.5Compare Source
Released on: 2025-12-16
This is a patch release that:
"deprecated functionality" annotations, like
@Deprecated.implement. Thisfix directs IDEs to not display such elements (like the
RegExpclass) asfully deprecated (for example, with struck-through text). (issue
dart-lang/sdk#62013)
dart-lang/sdk#62168)
!=operator. (issuedart-lang/sdk#62216)
v3.10.4Compare Source
Released on: 2025-12-09
This is a patch release that:
dart runnot working and simply exiting withProcess::Exec - (null)under GitBash on Windows.(issue dart-lang/sdk#61981)
v3.10.3Compare Source
Released on: 2025-12-02
This is a patch release that:
Dart-Code/Dart-Code#61978)
Running build hooksindart runwith--verbosity=error.(issue dart-lang/sdk#61996)
test_with_coverageand build hooks in dev dependencies.(issue dart-lang/tools#2237)
after a recompilation (issue flutter/flutter#178740).
shorthand with type arguments on a factory constructor in an abstract class.
(issue dart-lang/sdk#61978)
v3.10.2Compare Source
Released on: 2025-11-25
This is a patch release that:
invocation, as well as an issue with renaming dot shorthands.
(issue dart-lang/sdk#61969)
statements that contain int cases and a null case.
(issue dart-lang/sdk#62022)
constructor invocations.
(issue dart-lang/sdk#62036)
v3.10.1Compare Source
Released on: 2025-11-18
This is a patch release that:
==operator,FutureOrtypes, switch expressions, and switch statements.(issue dart-lang/sdk#61872).
instance method with a dot shorthand. (issue dart-lang/sdk#61954).
ExitDetectorin the analyzer missing a few visitormethods for dot shorthand AST nodes. (issue dart-lang/sdk#61963)
prefer_const_constructorslint was enabled (issue dart-lang/sdk#61953).@Deprecated.extend()and the other new deprecated annotations.v3.10.0Compare Source
Released on: 2025-11-12
Language
Dart 3.10 adds dot shorthands to the language. To use
them, set your package's [SDK constraint][language version] lower bound to 3.10
or greater (
sdk: '^3.10.0').Dart 3.10 also adjusts the inferred return type of a generator function (
sync*or
async*) to avoid introducing unneeded nullability.Dot shorthands
Dot shorthands allow you to omit the type name when accessing a static member
in a context where that type is expected.
These are some examples of ways you can use dot shorthands:
To learn more about the feature, check out the
feature specification.
Eliminate spurious Null from generator return type
The following local function
fused to have return typeIterable<int?>.The question mark in this type is spurious because the returned iterable
will never contain null (
return;stops the iteration, it does not add nullto the iterable). This feature makes the return type
Iterable<int>.This change may cause some code elements to be flagged as unnecessary. For
example,
f().first?.isEvenis flagged, andf().first.isEvenis recommendedinstead.
Tools
Analyzer
The analyzer includes a new plugin system. You can use this system to write
your own analysis rules and IDE quick fixes.
or warnings). You see these in your IDE and at the command line via
dart analyzeorflutter analyze.warning.
associated with a specific diagnostic.
See the documentation for writing an analyzer plugin, and the
documentation for using analyzer plugins to learn more.
Lint rules which are incompatible with each other and which are specified in
included analysis options files are now reported.
Offer to add required named field formal parameters in a constructor when a
field is not initialized.
Support the new
@Deprecatedannotations by reporting warnings when specificfunctionality of an element is deprecated.
Offer to import a library for an appropriate extension member when method or
property is accessed on a nullable value.
Offer to remove the
constkeyword for a constructor call which includes amethod invocation.
Remove support for the deprecated
@requiredannotation.Add two assists to bind constructor parameters to an existing or a
non-existing field.
Add a warning which is reported when an
@experimentalmember is usedoutside of the package in which it is declared.
Add a new lint rule,
remove_deprecations_in_breaking_versions, is added toencourage developers to remove any deprecated members when the containing
package has a "breaking version" number, like
x.0.0or0.y.0.(Thanks @FMorschel for many of the above
enhancements!)
Hooks
Support for hooks -- formerly know as native assets -- are now stable.
You can currently use hooks to do things such as compile or download native assets
(code written in other languages that are compiled into machine code),
and then call these assets from the Dart code of a package.
For more details see the hooks documentation.
Dart CLI and Dart VM
The Dart CLI and Dart VM have been split into two separate executables.
The Dart CLI tool has been split out of the VM into it's own embedder which
runs in AOT mode. The pure Dart VM executable is called
dartvmandhas no Dart CLI functionality in it.
The Dart CLI executable parses the CLI commands and invokes the rest
of the AOT tools in the same process, for the 'run' and 'test'
commands it execs a process which runs
dartvm.dart hello.dartexecs thedartvmprocess and runs thehello.dartfile.The Dart CLI is not generated for ia32 as we are not shipping a
Dart SDK for ia32 anymore (support to execute the
dartvmfor ia32architecture is retained).
Libraries
dart:asyncFuture.syncValueconstructor for creating a future with aknown value. Unlike
Future.value, it does not allow an asynchronousFuture<T>as the value of a newFuture<T>.dart:coreUri.parseIPv4Addressfunctionno longer incorrectly allows leading zeros. This also applies to
Uri.parseIPv6Addressfor IPv4 addresses embedded in IPv6 addresses.Uri.parseIPv4Addressaddsstartandendparametersto allow parsing a substring without creating a new string.
@Deprecated.extend()indicates the ability to extend a class isdeprecated.
@Deprecated.implement()indicates the ability to implement a class ormixin is deprecated.
@Deprecated.subclass()indicates the ability to extend a class orimplement a class or mixin is deprecated.
@Deprecated.mixin()indicates the ability to mix in a class isdeprecated.
@Deprecated.instantiate()indicates the ability to instantiate aclass is deprecated.
deprecated.
dart:ioIOOverridesas anabstract baseclass so it can no longer be implemented.
exit(...)toIOOverrides.dart:js_interopJSArray.addis added to avoid cases where during migration fromListtoJSArray,JSAnyOperatorExtension.addis accidentally used. See #59830for more details.
isA<JSBoxedDartObject>now checks that the value was the result of atoJSBoxoperation instead of returning true for all objects.@JS()annotation can now be used to change the name of keys in JavaScript. See
#55138 for more details.
Function.toJSnow apply totoJSCaptureThisaswell. Specifically, the function should be a statically known type, cannot
contain invalid types in its signature, cannot have any type parameters, and
cannot have any named parameters.
original typed array when unwrapped instead of instantiating a new typed array
with the same buffer. This applies to both the
.toJSconversions andjsify. See #61543 for more details.Uint16ListToJSInt16Arrayis renamed toUint16ListToJSUint16Array.JSUint16ArrayToInt16Listis renamed toJSUint16ArrayToUint16List.dartifynow converts JavaScriptPromisesto Dart
Futures rather thanJSValues, consistent with dart2js and DDC. See#54573 for more details.
createJSInteropWrappernow additionally takes an optional parameter whichspecifies the JavaScript prototype of the created object, similar to
createStaticInteropMockindart:js_util. See #61567 for more details.dart:js_utildart:js_utiland will throw anUnsupportedErrorif any API from this library is invoked. This also appliesto
package:js/js_util.dart.package:js/js.dartcontinues to be supported.See #61550 for more details.
v3.9.4Compare Source
Released on: 2025-09-30
Pub
dart pub get --examplewill now resolveexample/folders in theentire workspace, not only in the root package.
This fixes dart-lang/pub#4674 that made
flutter pub getcrash if the examples had not been resolved before resolving the workspace.
v3.9.3Compare Source
Released on: 2025-09-09
Tools
Development JavaScript compiler (DDC)
static calls are deeply nested within a closure.
When present this led to builds timing out or
taking several minutes rather than several seconds.
v3.9.2Compare Source
Released on: 2025-08-27
Tools
Development JavaScript compiler (DDC)
hot reload in a web development environment.
This led to possible side effects being triggered early or
crashes during the hot reload if the getter throws an exception.
v3.9.1Compare Source
Released on: 2025-08-20
This is a patch release that:
clicking 'Clear' on the Network Screen (issue dart-lang/sdk#61187).
a large amount of literals (issue flutter/flutter#172626).
tag_pattern,where the
pubspec.lockfile would not be stable whenrunning
dart pub get(issue dart-lang/pub#4644).v3.9.0Compare Source
Released on: 2025-08-13
Language
Dart 3.9 assumes null safety when computing type promotion, reachability, and
definite assignment. This makes these features produce more accurate results for
modern Dart programs. As a result of this change, more dead_code warnings may be
produced. To take advantage of these improvements, set your package's SDK
constraint lower bound to 3.9 or greater (
sdk: '^3.9.0').Tools
Analyzer
The dart command-line tool commands that use the analysis server now run
the AOT-compiled analysis server snapshot. These include
dart analyze,dart fix, anddart language-server.There is no functional difference when using the AOT-compiled analysis server
snapshot. But various tests indicate that there is a significant speedup in
the time to analyze a project.
In case of an incompatibility with the AOT-compiled snapshot, a
--no-use-aot-snapshotflag may be passed to these commands. (Please file anissue with the appropriate project if you find that you need to use this
flag! It will be removed in the future.) This flag directs the tool to revert
to the old behavior, using the JIT-compiled analysis server snapshot. To
direct the Dart Code plugin for VS Code to pass this flag, use the
dart.analyzerAdditionalArgssetting. To direct the DartIntelliJ plugin to pass this flag, use the
dart.server.additional.argumentsregistry property, similar to these steps.
Add the
switch_on_typelint rule.Add the
unnecessary_unawaitedlint rule.Support a new annotation,
@awaitNotRequired, which is used by thediscarded_futuresandunawaited_futureslint rules.Improve the
avoid_types_as_parameter_nameslint rule to include typeparameters.
The definition of an "obvious type" is expanded for the relevant lint rules,
to include the type of a parameter.
Many small improvements to the
discarded_futuresandunawaited_futureslint rules.
The code that calculates fixes and assists has numerous performance
improvements.
A new "Remove async" assist is available.
A new "Convert to normal parameter" assist is available for field formal
parameters.
New fixes are available for the following diagnostics:
for_in_of_invalid_typeimplicit_this_reference_in_initializerprefer_foreachundefined_operatoruse_if_null_to_convert_nulls_to_boolsNumerous fixes and improvements are included in the "create method," "create
getter," "create mixin," "add super constructor," and "replace final with
var" fixes.
Dependencies listed in
dependency_overridesin apubspec.yamlfile nowhave document links to pub.dev.
Improvements to type parameters and type arguments in the LSP type hierarchy.
Folding try/catch/finally blocks is now supported for LSP clients.
Improve code completion suggestions with regards to operators, extension
members, named parameters, doc comments, patterns, collection if-elements and
for-elements, and more.
Improve syntax highlighting of escape sequences in string literals.
Add "library cycle" information to the diagnostic pages.
(Thanks @FMorschel for many of the above
enhancements!)
Dart build
dart build -f exe <target>is nowdart build cli --target=<target>. Seedart build cli --helpfor more info.Dart Development Compiler (dartdevc)
Outstanding async code now checks and cancels itself after a hot restart if
it was started in a different generation of the application before the
restart. This includes outstanding
Futures created by callingJSPromise.toDartfrom thedart:js_interopand the underlying thedart:js_utilhelperpromiseToFuture. Dart callbacks will not be run, butcallbacks on the JavaScript side will still be executed.
Fixed a soundness issue that allowed direct invocation of the value returned
from a getter without any runtime checks when the getter's return type was a
generic type argument instantiated as
dynamicorFunction.A getter defined as:
Could trigger the issue with a direct invocation:
Dart native compiler
Added cross-compilation support for
target architectures of
arm(ARM32) andriscv64(RV64GC)when the target OS is Linux.
Pub
Git dependencies can now be version-solved based on git tags.
Use a
tag_patternin the descriptor and a version constraint, and allcommits matching the pattern will be considered during resolution. For
example:
Starting from language version 3.9 the
flutterconstraint upper bound is nowrespected in your root package. For example:
Results in
dart pub getfailing if invoked with a version ofthe Flutter SDK different from
3.33.0.The upper bound of the flutter constraint is still ignored in
packages used as dependencies.
See flutter/flutter#95472 for details.
v3.8.3Compare Source
Released on: 2025-07-31
This is a patch release that:
v3.8.2Compare Source
Released on: 2025-07-16
This is a patch release that:
v3.8.1Compare Source
Released on: 2025-05-28
This is a patch release that:
async function bodies (issue #60748).
v3.8.0Compare Source
Released on: 2025-05-20
Language
Dart 3.8 adds null-aware elements to the language. To use them, set
your package's [SDK constraint][language version] lower bound to 3.8
or greater (
sdk: '^3.8.0').Null-aware elements
Null-aware elements make it easier to omit a value from a collection literal if
it's
null. The syntax works in list literals, set literals, and map literals.Within map literals, both null-aware keys and values are supported.
Here is an example a list literal written in both styles,
without using null-aware elements and using them:
To learn more about null-aware collection elements,
check out the documentation
and the feature specification.
Libraries
dart:coreIterable.withIteratorconstructor.dart:ioHttpClientBearerCredentials.Stdout.supportsAnsiEscapesandStdin.supportsAnsiEscapestoreturn
trueforTERMcontainingtmuxvalues.dart:htmldart:html, likeHtmlElement, can nolonger be extended. Long ago, to support custom elements, element classes
exposed a
.createdconstructor that adhered to the v0.5 spec of webcomponents. On this release, those constructors have been removed and with
that change, the classes can no longer be extended. In a future change, they
may be marked as interface classes as well. This is a follow up from an
earlier breaking change in 3.0.0 that removed the
registerElementAPIs. See#53264 for details.
dart:ffiArray.elementswhich exposes anIterableover theArray's content.Tools
Analyzer
enables external elements to be referenced in documentation comments without
actually importing them. See the
documentation
for details.
the suggestions are improved when completing text in a comment reference on a
documentation comment for an extension, a typedef, or a directive (an import,
an export, or a library). Additionally, instance members can now be suggested
in a documentation comment reference.
FutureBuilderwidget.ValueListenableBuilder.getter declaration.
omitting types:
omit_local_variable_types,omit_obvious_local_variable_types, andomit_obvious_property_types.invocation" error.
thisreferences in order to avoidname collisions.
in subclasses in other libraries.
showclause or removes names from ahideclause can now add or remove multiple names simultaneously, in order toresolve as many "undefined" errors as possible.
required arguments.
showorhideclauses, which are never necessary.autocompletion.
use_null_aware_elementslint rule.unnecessary_ignorelint rule.enhancements!)
Dart Development Compiler (dartdevc)
In order to align with dart2js semantics, DDC will now throw a runtime error
when a redirecting factory is torn off and one of its optional non-nullable
parameters is provided no value. The implicit null passed to the factory will
not match the non-nullable type and this will now throw.
In the future this will likely be a compile-time error and will be entirely
disallowed.
Dart to Javascript Compiler (dart2js)
Removed the
--experiment-new-rtiand--use-old-rtiflags.Dart native compiler
Added cross-compilation support for the
Linux x64 and Linux ARM64 target platforms.
Dart format
In 3.7.0, we released a largely rewritten formatter supporting a new
"tall" style. Since then, we've gotten a lot of feedback and bug
reports and made a number of fixes in response to that.
Features
Some users strongly prefer the old behavior where a trailing comma will be
preserved by the formatter and force the surrounding construct to split. That
behavior is supported again (but off by default) and can enabled by adding this
to a surrounding
analysis_options.yamlfile:This is similar to how trailing commas work in the old short style formatter
applied to code before language version 3.7.
Bug fixes
a trailing comment (issue dart-lang/dart_style#1639).
Style changes
The following style changes are language versioned and only
affect code whose [language version][] is 3.8 or later.
Dart code at 3.7 or earlier is formatted the same as it was before.
Allow more code on the same line as a named argument or
=>.Allow the target or property chain part of a split method chain on the RHS of
=,:, and=>.Allow the condition part of a split conditional expression on the RHS of
=,:, and=>.Don't indent conditional branches redundantly after
=,:, and=>.Indent conditional branches past the operators.
Block format record types in typedefs:
Eagerly split argument lists whose contents are complex enough to be easier
to read spread across multiple lines even if they would otherwise fit on a
single line.
The heuristic is that the argument list must contain at least three named
arguments, some of which are nested and some of which are not.
v3.7.3Compare Source
Released on: 2025-04-16
This is a patch release that:
v3.7.2Compare Source
Released on: 2025-03-12
This is a patch release that:
js-stringbuiltin function with anon-nullable parameter type where it must use a nullable one (issue #59899).
v3.7.1Compare Source
Released on: 2025-02-26
This is a patch release that:
traffic to be dropped (issue #8888).
factory constructors containing generic local functions (issue #160338).
in formal parameters, causing the wildcard variables to appear in
variable lists while debugging (issue #60121).
v3.7.0Compare Source
Released on: 2025-02-12
Language
Dart 3.7 adds wildcard variables and inference using
bounds to the language. To use
them, set your package's [SDK constraint][language version] lower
bound to 3.7 or greater (
sdk: '^3.7.0').Wildcard variables
Local variables and parameters named
_are now non-binding and they canbe declared multiple times without collisions. You will no longer be able to use
these variables nor access their values. All wildcard variable declaration types
that have this behavior are described in the
wildcard variables specification.
Top-level variables, top-level function names, type names, member names, etc.
are unchanged. They can be named
_and used as they are today.These are a few examples of where wildcard variables can be used:
Inference using bounds
With the inference using bounds feature, Dart's type inference
algorithm generates constraints by combining existing constraints with
the declared type bounds, not just best-effort approximations.
This is especially important for F-bounded types, where inference
using bounds correctly infers that, in the example below,
Xcan bebound to
B. Without the feature, the type argument must be specifiedexplicitly:
f<B>(C()):The feature is described in more details in the
inference using bounds specification.
Other language changes
Nullusing
isoras, this type promotion is now properly accounted for inreachability analysis. This makes the type system more self-consistent,
because it mirrors the behavior of promoted local variables. This change is
not expected to make any difference in practice.
Tools
Analyzer
declaration.
prefer_relative_importsandalways_use_package_importslint rules.~/operation into/, when the~/operation is not available.
awaitif the expression is currentlynot assignable, but awaiting it would make it assignable.
forEachcall into a for-loop nowconsider the
prefer_final_in_for_eachandalways_specify_typeslintrules.
cascade_invocationslint rule violation.Expandedwidget,and with a
Flexiblewidget.else-block to read
else if.use_decorated_boxby swapping theContainerwithColoredBoxas suggested by the lint.the
showcombinator on an existing import.import directive with the given prefix.
hidecombinator.
showcombinator, and optionally a prefix.initializer of a late field.
prefer_const_declarationslint rule, preferring to addconstto a variabledeclaration rather than the initial value.
onkeyword in an extension declaration.override.
(Thanks @FMorschel for the above enhancements!
sort_constructors_firstlintrule.
function-typed parameters.
strict_top_level_inference] lint rule.unnecessary_underscores][] lint rule.specify_nonobvious_property_types][] lint rule.omit_obvious_property_types][] lint rule.unnecessary_async][] lint rule.unsafe_variance][] lint rule.package_api_docs][] lint rule.Configuration
📅 Schedule: (in timezone Africa/Johannesburg)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.