NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #112 most downloaded on pub.dev
A library used to spawn the Dart Developer Service, used to communicate with a Dart VM Service instance.
Last release 2 months ago
16 Jul 2026
Release timing varies
gaps range from 2 weeks to 7 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
6 years old
105 releases · first in 2020
One column per quarter.
Fixed an issue where debug adapters would not automatically close after terminating/disconnecting from the debugee.
Updated devtools_shared version to 2.14.1.
devtools_shared version to 2.14.1.Fix an issue where DAP adapters could try to remove the same breakpoint multiple times.
- Internal DAP changes.
Updated vm_service version to 9.0.0.
vm_service version to 9.0.0.Reduce latency of streamListen calls through improved locking behavior.
streamListen calls through improved locking behavior.Breaking change: The klass getter on the InstanceConstant class in the Kernel AST API has been renamed to classNode for consistency.
Sets now have a literal syntax like lists and maps do:
var set = {1, 2, 3};
Using curly braces makes empty sets ambiguous with maps:
var collection = {}; // Empty set or map?
To avoid breaking existing code, an ambiguous literal is treated as a map. To create an empty set, you can rely on either a surrounding context type or an explicit type argument:
// Variable type forces this to be a set:
Set<int> set = {};
// A single type argument means this must be a set:
var set2 = <int>{};
Set literals are released on all platforms. The set-literals experiment flag
has been disabled.
The DEPRECATED_MEMBER_USE hint was split into two hints:
DEPRECATED_MEMBER_USE reports on usage of @deprecated members declared
in a different package.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE reports on usage of @deprecated
members declared in the same package.Upgraded the linter to 0.1.82 which adds the following improvements:
provide_deprecation_message, and
use_full_hex_values_for_flutter_colors, prefer_null_aware_operators.prefer_const_declarations set literal false-positives.prefer_collection_literals to support set literals.unnecessary_parenthesis play nicer with cascades.hash_and_equals to respect hashCode fields.package:kernelBreaking change: The klass getter on the InstanceConstant class in the
Kernel AST API has been renamed to classNode for consistency.
Breaking change: Updated Link implementation to utilize true symbolic
links instead of junctions on Windows. Existing junctions will continue to
work with the new Link implementation, but all new links will create
symbolic links.
To create a symbolic link, Dart must be run with administrative privileges or
Developer Mode must be enabled, otherwise a FileSystemException will be
raised with errno set to ERROR_PRIVILEGE_NOT_HELD (Issue 33966).
package:dds/devtools_server.dart.- Re-release 2.1.6+1.
Improve performance of CPU sample caching.
- Fix dependencies.
- Roll back to 2.1.5.
- Roll back to 2.1.4.
A new library package:dds/dap.dart exposes classes required to build a custom DAP debug-adapter on top of the base Dart DAP functionality in DDS. For
package:dds/dap.dart exposes classes required to build a custom DAP
debug-adapter on top of the base Dart DAP functionality in DDS.
For more details on DAP support in Dart see
this README.Ensure cancelling multiple historical streams with the same name doesn't cause an asynchronous StateError to be thrown.
StateError to be thrown.Silently handle exceptions that occur within RPC request handlers.
There are a couple of very minor breaking changes:
This is a patch version release. Again, the team's focus was mostly on improving performance and stability after the large changes in Dart 2.0.0. In particular, dart2js now always uses the "fast startup" emitter and the old emitter has been removed.
There are a couple of very minor breaking changes:
In dart:io, adding to a closed IOSink now throws a StateError.
On the Dart VM, a soundness hole when using dart:mirrors to reflectively
invoke a method in an incorrect way that violates its static types has been
fixed (Issue 35611).
This release has no language changes.
dart:coreDateTime.parse() also recognize , as a valid decimal separator when
parsing from a string (Issue 35576).dart:htmlAdded methods Element.removeAttribute, Element.removeAttributeNS,
Element.hasAttribute and Element.hasAttributeNS. (Issue 35655).
Improved dart2js compilation of element.attributes.remove(name) to generate
element.removeAttribute(name), so that there is no performance reason to
migrate to the above methods.
Fixed a number of dart:html bugs:
dart:html (Issue 34318).ondblclick and dblclickEvent for Angular analyzer.removeAll on classes; elements parameter should be
Iterable<Object> to match Set's removeAll not Iterable<E> (Issue
30278).dart:ioIOSink now throws a StateError.In previous releases it was possible to violate static types using
dart:mirrors. This code would run without any TypeErrors and print
"impossible" output:
import 'dart:mirrors';
class A {
void method(int v) {
if (v != null && v is! int) {
print("This should be impossible: expected null or int got ${v}");
}
}
}
void main() {
final obj = A();
reflect(obj).invoke(#method, ['not-an-number']);
}
This bug is fixed now. Only code that already violates static typing will break. See Issue 35611 for more details.
The old "full emitter" back-end is removed and dart2js always uses the "fast
startup" back-end. The generated fast startup code is optimized to load
faster, even though it can be slightly larger. The --fast-startup and
--no-fast-startup are allowed but ignored. They will be removed in a future
version.
We fixed a bug in how deferred constructor calls were incorrectly not marked as deferred. The old behavior didn't cause breakages, but was imprecise and pushed more code to the main output unit.
A new deferred split algorithm implementation was added.
This implementation fixes a soundness bug and addresses performance issues of the previous implementation, because of that it can have a visible impact on apps. In particular:
We fixed a performance issue which was introduced when we migrated to the common front-end. On large apps, the fix can cut 2/3 of the time spent on this task.
We fixed a bug in how inferred types were categorized (Issue 35311). The old behavior was unsound and could produce broken programs. The fix may cause more code to be pulled into the main output unit.
This shows up frequently when returning deferred values from closures since the closure's inferred return type is the deferred type. For example, if you have:
() async {
await deferred_prefix.loadLibrary();
return new deferred_prefix.Foo();
}
The closure's return type is Future<Foo>. The old implementation defers
Foo, and incorrectly makes the return type Future<dynamic>. This may
break in places where the correct type is expected.
The new implementation will not defer Foo, and will place it in the main
output unit. If your intent is to defer it, then you need to ensure the
return type is not inferred to be Foo. For example, you can do so by
changing the code to a named closure with a declared type, or by ensuring
that the return expression has the type you want, like:
() async {
await deferred_prefix.loadLibrary();
return new deferred_prefix.Foo() as dynamic;
}
Because the new implementation might require you to inspect and fix your app, we exposed two temporary flags:
The --report-invalid-deferred-types causes dart2js to run both the old and
new algorithms and report any cases where an invalid type was detected.
The --new-deferred-split flag enables this new algorithm.
The --categories=* flag is being replaced. --categories=all was only used
for testing and it is no longer supported. --categories=Server continues to
work at this time but it is deprecated, please use --server-mode instead.
The --library-root flag was replaced by --libraries-spec. This flag is
rarely used by developers invoking dart2js directly. It's important for
integrating dart2js with build systems. See --help for more details on the
new flag.
Support for declarations-casts has been removed and the implicit-casts
option now has the combined semantics of both options. This means that users
that disable implicit-casts might now see errors that were not previously
being reported.
New hints added:
NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR and
NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW inform you when a
@literal const constructor is called in a non-const context (or with
new).INVALID_LITERAL_ANNOTATION reports when something other than a const
constructor is annotated with @literal.SUBTYPE_OF_SEALED_CLASS reports when any class or mixin subclasses
(extends, implements, mixes in, or constrains to) a @sealed class, and the
two are declared in different packages.MIXIN_ON_SEALED_CLASS reports when a @sealed class is used as a
superclass constraint of a mixin.Default styles now work much better on mobile. Simple browsing and searching of API docs now work in many cases.
Upgraded the linter to 0.1.78 which adds the following improvements:
prefer_final_in_for_each, unnecessary_await_in_return,
use_function_type_syntax_for_parameters, avoid_returning_null_for_future,
and avoid_shadowing_type_parameters.invariant_booleans status to experimental.type_annotate_public_apis false positives on local functions.avoid_shadowing_type_parameters to report shadowed type parameters in
generic typedefs.use_setters_to_change_properties to not wrongly lint overriding
methods.cascade_invocations to not lint awaited targets.prefer_conditional_assignment false positives.join_return_with_assignment false positives.cascade_invocations false positives.prefer_bool_in_asserts as it is redundant in Dart 2.LateInitializationError being thrown when trying to
cleanup after an error during initialization.Breaking change: A number of static errors that should have been detected and reported were not supported in 2.0.0. These are reported now, which mean…
This is a minor version release. The team's focus was mostly on improving performance and stability after the large changes in Dart 2.0.0. Notable changes:
We've introduced a dedicated syntax for declaring a mixin. Instead of the
class keyword, it uses mixin:
mixin SetMixin<E> implements Set<E> {
...
}
The new syntax also enables super calls inside mixins.
Integer literals now work in double contexts. When passing a literal number to
a function that expects a double, you no longer need an explicit .0 at the
end of the number. In releases before 2.1, you need code like this when
setting a double like fontSize:
TextStyle(fontSize: 18.0)
Now you can remove the .0:
TextStyle(fontSize: 18)
In releases before 2.1, fontSize : 18 causes a static error. This was a
common mistake and source of friction.
Breaking change: A number of static errors that should have been detected and reported were not supported in 2.0.0. These are reported now, which means existing incorrect code may show new errors.
dart:core now exports Future and Stream. You no longer need to import
dart:async to use those very common types.
Introduced a new syntax for mixin declarations.
mixin SetMixin<E> implements Set<E> {
...
}
Most classes that are intended to be used as mixins are intended to only be
used as mixins. The library author doesn't want users to be able to construct
or subclass the class. The new syntax makes that intent clear and enforces it
in the type system. It is an error to extend or construct a type declared
using mixin. (You can implement it since mixins expose an implicit
interface.)
Over time, we expect most mixin declarations to use the new syntax. However, if you have a "mixin" class where users are extending or constructing it, note that moving it to the new syntax is a breaking API change since it prevents users from doing that. If you have a type like this that is a mixin as well as being a concrete class and/or superclass, then the existing syntax is what you want.
If you need to use a super inside a mixin, the new syntax is required. This
was previously only allowed with the experimental --supermixins flag because
it has some complex interactions with the type system. The new syntax
addresses those issues and lets you use super calls by declaring the
superclass constraint your mixin requires:
class Superclass {
superclassMethod() {
print("in superclass");
}
}
mixin SomeMixin on Superclass {
mixinMethod() {
// This is OK:
super.superclassMethod();
}
}
class GoodSub extends Superclass with SomeMixin {}
class BadSub extends Object with SomeMixin {}
// Error: Since the super() call in mixinMethod() can't find a
// superclassMethod() to call, this is prohibited.
Even if you don't need to use super calls, the new mixin syntax is good
because it clearly expresses that you intend the type to be mixed in.
Allow integer literals to be used in double contexts. An integer literal used in a place where a double is required is now interpreted as a double value. The numerical value of the literal needs to be precisely representable as a double value.
Integer literals compiled to JavaScript are now allowed to have any value that
can be exactly represented as a JavaScript Number. They were previously
limited to such numbers that were also representable as signed 64-bit
integers.
(Breaking) A number of static errors that should have been detected and reported were not supported in 2.0.0. These are reported now, which means existing incorrect code may show new errors:
Setters with the same name as the enclosing class aren't allowed. (Issue 34225.) It is not allowed to have a class member with the same name as the enclosing class:
class A {
set A(int x) {}
}
Dart 2.0.0 incorrectly allows this for setters (only). Dart 2.1.0 rejects it.
To fix: This is unlikely to break anything, since it violates all style guides anyway.
Constant constructors cannot redirect to non-constant constructors. (Issue 34161.) It is not allowed to have a constant constructor that redirects to a non-constant constructor:
class A {
const A.foo() : this(); // Redirecting to A()
A() {}
}
Dart 2.0.0 incorrectly allows this. Dart 2.1.0 rejects it.
To fix: Make the target of the redirection a properly const constructor.
Abstract methods may not unsoundly override a concrete method. (Issue 32014.) Concrete methods must be valid implementations of their interfaces:
class A {
num get thing => 2.0;
}
abstract class B implements A {
int get thing;
}
class C extends A with B {}
// 'thing' from 'A' is not a valid override of 'thing' from 'B'.
main() {
print(new C().thing.isEven); // Expects an int but gets a double.
}
Dart 2.0.0 allows unsound overrides like the above in some cases. Dart 2.1.0 rejects them.
To fix: Relax the type of the invalid override, or tighten the type of the overridden method.
Classes can't implement FutureOr. (Issue 33744.) Dart doesn't allow classes to implement the FutureOr type:
class A implements FutureOr<Object> {}
Dart 2.0.0 allows classes to implement FutureOr. Dart 2.1.0 does not.
To fix: Don't do this.
Type arguments to generic typedefs must satisfy their bounds. (Issue 33308.) If a parameterized typedef specifies a bound, actual arguments must be checked against it:
class A<X extends int> {}
typedef F<Y extends int> = A<Y> Function();
F<num> f = null;
Dart 2.0.0 allows bounds violations like F<num> above. Dart 2.1.0 rejects
them.
To fix: Either remove the bound on the typedef parameter, or pass a valid argument to the typedef.
Constructor invocations must use valid syntax, even with optional new.
(Issue 34403.) Type arguments to generic named constructors go after the
class name, not the constructor name, even when used without an explicit
new:
class A<T> {
A.foo() {}
}
main() {
A.foo<String>(); // Incorrect syntax, was accepted in 2.0.0.
A<String>.foo(); // Correct syntax.
}
Dart 2.0.0 accepts the incorrect syntax when the new keyword is left out.
Dart 2.1.0 correctly rejects this code.
To fix: Move the type argument to the correct position after the class name.
Instance members should shadow prefixes. (Issue 34498.) If the same name is used as an import prefix and as a class member name, then the class member name takes precedence in the class scope.
import 'dart:core';
import 'dart:core' as core;
class A {
core.List get core => null; // "core" refers to field, not prefix.
}
Dart 2.0.0 incorrectly resolves the use of core in core.List to the prefix
name. Dart 2.1.0 correctly resolves this to the field name.
To fix: Change the prefix name to something which does not clash with the instance member.
Implicit type arguments in extends clauses must satisfy the class bounds.
(Issue 34532.) Implicit type arguments for generic classes are computed if
not passed explicitly, but when used in an extends clause they must be
checked for validity:
class Foo<T> {}
class Bar<T extends Foo<T>> {}
class Baz extends Bar {} // Should error because Bar completes to Bar<Foo>
Dart 2.0.0 accepts the broken code above. Dart 2.1.0 rejects it.
To fix: Provide explicit type arguments to the superclass that satisfy the bound for the superclass.
Mixins must correctly override their superclasses. (Issue 34235.) In some rare cases, combinations of uses of mixins could result in invalid overrides not being caught:
class A {
num get thing => 2.0;
}
class M1 {
int get thing => 2;
}
class B = A with M1;
class M2 {
num get thing => 2.0;
}
class C extends B with M2 {} // 'thing' from 'M2' not a valid override.
main() {
M1 a = new C();
print(a.thing.isEven); // Expects an int but gets a double.
}
Dart 2.0.0 accepts the above example. Dart 2.1.0 rejects it.
To fix: Ensure that overriding methods are correct overrides of their superclasses, either by relaxing the superclass type, or tightening the subclass/mixin type.
dart:asyncstream.take(0).drain(value) would not correctly
forward the value through the returned Future.StreamTransformer.fromBind constructor.Stream.fromIterable to send a done event after the error when the
iterator's moveNext throws, and handle if the current getter throws (issue
33431).dart:coreHashMap.fromEntries and LinkedHashmap.fromEntries constructors.ArgumentError.checkNotNull utility method.Uri parsing more permissive about [ and ] occurring in the path,
query or fragment, and # occurring in fragment.Future and Stream from dart:core.&, | and ^ to bool.UnmodifiableMapMixin. Some maps intended to be
unmodifiable incorrectly allowed new methods added in Dart 2 to succeed.provisional annotation and the Provisional annotation
class. These should have been removed before releasing Dart 2.0, and they have
no effect.dart:htmlFixed Service Workers and any Promise/Future API with a Dictionary parameter.
APIs in dart:html (that take a Dictionary) will receive a Dart Map parameter. The Map parameter must be converted to a Dictionary before passing to the browser's API. Before this change, any Promise/Future API with a Map/Dictionary parameter never called the Promise and didn't return a Dart Future - now it does.
This caused a number of breaks especially in Service Workers (register, etc.). Here is a complete list of the fixed APIs:
BackgroundFetchManager
Future<BackgroundFetchRegistration> fetch(String id, Object requests, [Map options])CacheStorage
Future match(/*RequestInfo*/ request, [Map options])CanMakePayment
Future<List<Client>> matchAll([Map options])CookieStore
Future getAll([Map options])Future set(String name, String value, [Map options])CredentialsContainer
Future get([Map options])Future create([Map options])ImageCapture
Future setOptions(Map photoSettings)MediaCapabilities
Future<MediaCapabilitiesInfo> decodingInfo(Map configuration)Future<MediaCapabilitiesInfo> encodingInfo(Map configuration)MediaStreamTrack
Future applyConstraints([Map constraints])Navigator
Future requestKeyboardLock([List<String> keyCodes])Future requestMidiAccess([Map options])Future share([Map data])OffscreenCanvas
Future<Blob> convertToBlob([Map options])PaymentInstruments
Future set(String instrumentKey, Map details)Permissions
Future<PermissionStatus> query(Map permission)Future<PermissionStatus> request(Map permissions)Future<PermissionStatus> revoke(Map permission)PushManager
Future permissionState([Map options])Future<PushSubscription> subscribe([Map options])RtcPeerConnection
Changed:
Future createAnswer([options_OR_successCallback,
RtcPeerConnectionErrorCallback failureCallback,
Map mediaConstraints])
to:
Future<RtcSessionDescription> createAnswer([Map options])
Changed:
Future createOffer([options_OR_successCallback,
RtcPeerConnectionErrorCallback failureCallback,
Map rtcOfferOptions])
to:
Future<RtcSessionDescription> createOffer([Map options])
Changed:
Future setLocalDescription(Map description,
VoidCallback successCallback,
[RtcPeerConnectionErrorCallback failureCallback])
to:
Future setLocalDescription(Map description)
Changed:
Future setLocalDescription(Map description,
VoidCallback successCallback,
[RtcPeerConnectionErrorCallback failureCallback])
to:
Future setRemoteDescription(Map description)
ServiceWorkerContainer
Future<ServiceWorkerRegistration> register(String url, [Map options])ServiceWorkerRegistration
Future<List<Notification>> getNotifications([Map filter])Future showNotification(String title, [Map options])VRDevice
Future requestSession([Map options])Future supportsSession([Map options])VRSession
Future requestFrameOfReference(String type, [Map options])Window
Future fetch(/*RequestInfo*/ input, [Map init])WorkerGlobalScope
Future fetch(/*RequestInfo*/ input, [Map init])In addition, exposed Service Worker "self" as a static getter named "instance". The instance is exposed on four different Service Worker classes and can throw a InstanceTypeError if the instance isn't of the class expected (WorkerGlobalScope.instance will always work and not throw):
SharedWorkerGlobalScope.instanceDedicatedWorkerGlobalScope.instanceServiceWorkerGlobalScope.instanceWorkerGlobalScope.instancedart:io(Breaking) Duplicate keys in a const map are not allowed and produce a compile-time error. Dart2js used to report this as a warning before. This was already an error in dartanalyzer and DDC and will be an error in other tools in the future as well.
Added -O flag to tune optimization levels. For more details run
dart2js -h -v.
We recommend to enable optimizations using the -O flag instead of individual
flags for each optimization. This is because the -O flag is intended to be
stable and continue to work in future versions of dart2js, while individual
flags may come and go.
At this time we recommend to test and debug with -O1 and to deploy with
-O3.
Bumped the linter to 0.1.70 which includes the following new lints:
avoid_returning_null_for_voidsort_pub_dependenciesprefer_mixinavoid_implementing_value_typesflutter_style_todosavoid_void_asyncprefer_void_to_nulland improvements:
prefer_iterable_whereType.await_only_futuresnull_closuressort_constructors_first to apply to all members.unnecessary_this to work on field initializers.unawaited_futures to ignore assignments within cascades.invariant_booleans.unawaited_futures.unawaited_futures to check cascades.void_checks (allowing T Function() to be assigned to
void Function()).lines_longer_than_80_chars.--checked flag to pub run to --enable-asserts.--packages-dir flag is now ignored.Nothing published for this version
Nothing published for this version
Fix possibility of LateInitializationError being thrown when trying to cleanup after an error during initialization.
LateInitializationError being thrown when trying to
cleanup after an error during initialization.Update package:vm_service to ^7.0.0.
package:vm_service to ^7.0.0.The Dart 1.0 syntax is supported but deprecated.
This is the first major version release of Dart since 1.0.0, so it contains many significant changes across all areas of the platform. Large changes include:
(Breaking) The unsound optional static type system has been replaced with a sound static type system using type inference and runtime checks. This was formerly called "strong mode" and only used by the Dart for web products. Now it is the one official static type system for the entire platform and replaces the previous "checked" and "production" modes.
(Breaking) Functions marked async now run synchronously until the first
await statement. Previously, they would return to the event loop once at the
top of the function body before any code runs (issue 30345).
(Breaking) Constants in the core libraries have been renamed from
SCREAMING_CAPS to lowerCamelCase.
(Breaking) Many new methods have been added to core library classes. If you implement the interfaces of these classes, you will need to implement the new methods.
(Breaking) "dart:isolate" and "dart:mirrors" are no longer supported when using Dart for the web. They are still supported in the command-line VM.
(Breaking) Pub's transformer-based build system has been replaced by a new build system.
The new keyword is optional and can be omitted. Likewise, const can be
omitted inside a const context (issue 30921).
Dartium is no longer maintained or supported.
"Strong mode" is now the official type system of the language.
The new keyword is optional and can be omitted. Likewise, const can be
omitted inside a const context.
A string in a part of declaration may now be used to refer to the library
this file is part of. A library part can now declare its library as either:
part of name.of.library;
Or:
part of "uriReferenceOfLibrary.dart";
This allows libraries with no library declarations (and therefore no name) to have parts, and it allows tools to easily find the library of a part file. The Dart 1.0 syntax is supported but deprecated.
Functions marked async now run synchronously until the first await
statement. Previously, they would return to the event loop once at the top of
the function body before any code runs (issue 30345).
The type void is now a Top type like dynamic, and Object. It also now
has new errors for being used where not allowed (such as being assigned to any
non-void-typed parameter). Some libraries (importantly, mockito) may need to
be updated to accept void values to keep their APIs working.
Future flattening is now done only as specified in the Dart 2.0 spec, rather
than more broadly. This means that the following code has an error on the
assignment to y.
test() {
Future<int> f;
var x = f.then<Future<List<int>>>((x) => []);
Future<List<int>> y = x;
}
Invocations of noSuchMethod() receive default values for optional args. The
following program used to print "No arguments passed", and now prints "First
argument is 3".
abstract class B {
void m([int x = 3]);
}
class A implements B {
noSuchMethod(Invocation i) {
if (i.positionalArguments.length == 0) {
print("No arguments passed");
} else {
print("First argument is ${i.positionalArguments[0]}");
}
}
}
void main() {
A().m();
}
Bounds on generic functions are invariant. The following program now issues an invalid override error (issue 29014):
class A {
void f<T extends int>() {}
}
class B extends A {
@override
void f<T extends num>() {}
}
Numerous corner case bugs around return statements in synchronous and asynchronous functions fixed. Specifically:
An empty return; in an async function with return type Future<Object> does
not report an error.
return exp; where exp has type void in an async function is now an error
unless the return type of the function is void or dynamic.
Mixed return statements of the form return; and return exp; are now
allowed when exp has type void.
A compile time error is emitted for any literal which cannot be exactly represented on the target platform. As a result, dart2js and DDC report errors if an integer literal cannot be represented exactly in JavaScript (issue 33282).
New member conflict rules have been implemented. Most cases of conflicting members with the same name are now static errors (issue 33235).
Replaced UPPER_CASE constant names with lowerCamelCase. For example,
HTML_ESCAPE is now htmlEscape.
The Web libraries were re-generated using Chrome 63 WebIDLs (details).
dart:asyncStream:
cast and castFrom.firstWhere, lastWhere, and singleWhere to return Future<T>
and added an optional T orElse() callback.StreamTransformer: added cast and castFrom.StreamTransformerBase: new class.Timer: added tick property.Zone
bindBinaryCallbackGuarded, bindCallbackGuarded, and
bindUnaryCallbackGuarded.Zone.ROOT to Zone.root.defaultValue parameter on Stream.firstWhere and
Stream.lastWhere.dart:cliwaitFor: function that suspends a stack to wait for a Future to complete.dart:collectionMapBase: added mapToString.LinkedHashMap no longer implements HashMapLinkedHashSet no longer implements HashSet.of constructor to Queue, ListQueue, DoubleLinkedQueue,
HashSet, LinkedHashSet, SplayTreeSet, Map, HashMap, LinkedHashMap,
SplayTreeMap.Maps class. Extend MapBase or mix in MapMixin instead to provide
map method implementations for a class.Document method getCSSCanvasContext and property
supportsCssCanvasContext.Element property xtag no longer supported in browsers.ServiceWorker class.MessageChannel and MessagePort addEventListener
automatically calls start method to receive queued messages.dart:convertBase64Codec.decode return type is now Uint8List.JsonUnsupportedObjectError: added partialResult propertyLineSplitter now implements StreamTransformer<String, String> instead of
Converter. It retains Converter methods convert and
startChunkedConversion.Utf8Decoder when compiled with dart2js uses the browser's TextDecoder in
some common cases for faster decoding.ASCII, BASE64, BASE64URI, JSON, LATIN1 and UTF8 to
ascii, base64, base64Uri, json, latin1 and utf8.HtmlEscapeMode constants UNKNOWN, ATTRIBUTE, SQ_ATTRIBUTE
and ELEMENT to unknown, attribute, sqAttribute and elements.jsonEncode, jsonDecode, base64Encode, base64UrlEncode and
base64Decode top-level functions.encode on AsciiCodec and Latin1Codec, and
convert on AsciiEncoder, Latin1Encoder, to Uint8List.utf8.decoder.fuse(json.decoder) to ignore leading Unicode BOM.dart:coreBigInt class added to support integers greater than 64-bits.proxy annotation.Provisional class and provisional field.pragma annotation.RegExp added static escape function.Uri class now correctly handles paths while running on Node.js on
Windows.Iterable added members cast, castFrom, followedBy and whereType.Iterable.singleWhere added orElse parameter.List added + operator, first and last setters, and indexWhere and
lastIndexWhere methods, and static copyRange and writeIterable
methods.Map added fromEntries constructor.Map added addEntries, cast, entries, map, removeWhere, update
and updateAll members.MapEntry: new class used by Map.entries.IterableBase, ListBase, SetBase or
MapBase (or uses the corresponding mixins) from dart:collection, the new
members are implemented automatically.of constructor to List, Set, Map.double.INFINITY, double.NEGATIVE_INFINITY, double.NAN,
double.MAX_FINITE and double.MIN_POSITIVE to double.infinity,
double.negativeInfinity, double.nan, double.maxFinite and
double.minPositive.DateTime to lower case: MONDAY through
SUNDAY, DAYS_PER_WEEK (as daysPerWeek), JANUARY through DECEMBER and
MONTHS_PER_YEAR (as monthsPerYear).Duration to lower case:
MICROSECONDS_PER_MILLISECOND to microsecondsPerMillisecond,
MILLISECONDS_PER_SECOND to millisecondsPerSecond, SECONDS_PER_MINUTE to
secondsPerMinute, MINUTES_PER_HOUR to minutesPerHour, HOURS_PER_DAY to
hoursPerDay, MICROSECONDS_PER_SECOND to microsecondsPerSecond,
MICROSECONDS_PER_MINUTE to microsecondsPerMinute, MICROSECONDS_PER_HOUR
to microsecondsPerHour, MICROSECONDS_PER_DAY to microsecondsPerDay,
MILLISECONDS_PER_MINUTE to millisecondsPerMinute, MILLISECONDS_PER_HOUR
to millisecondsPerHour, MILLISECONDS_PER_DAY to millisecondsPerDay,
SECONDS_PER_HOUR to secondsPerHour, SECONDS_PER_DAY to secondsPerDay,
MINUTES_PER_DAY to minutesPerDay, and ZERO to zero.typeArguments to Invocation class.Invocation
objects directly, without going through noSuchMethod.unaryMinus and empty constant symbols on the Symbol class.UriData.dataAsBytes to Uint8List.tryParse static method to int, double, num, BigInt, Uri and
DateTime.onError parameter on int.parse, double.parse and num.parse.NoSuchMethodError constructor.int.parse on the VM no longer accepts unsigned hexadecimal numbers greater
than or equal to 2**63 when not prefixed by 0x. (SDK issue
32858)dart:developerFlow class added.Timeline.startSync and Timeline.timeSync now accepts an optional parameter
flow of type Flow. The flow parameter is used to generate flow timeline
events that are enclosed by the slice described by
Timeline.{start,finish}Sync and Timeline.timeSync.<!-- Still need entries for all changes to dart:html since 1.x -->
dart:htmlquery and queryAll. Use querySelector and
querySelectorAll.dart:ioHttpStatus added UPGRADE_REQUIRED.IOOverrides and HttpOverrides added to aid in writing tests that wish to
mock varios dart:io objects.Platform.operatingSystemVersion added that gives a platform-specific String
describing the version of the operating system.ProcessStartMode.INHERIT_STDIO added, which allows a child process to
inherit the parent's stdio handles.RawZLibFilter added for low-level access to compression and decompression
routines.SecureSocket, SecurityContext, and X509Certificate
to be consistent across all platforms. All SecureSocket, SecurityContext,
and X509Certificate properties and methods are now supported on iOS and OSX.SecurityContext.alpnSupported deprecated as ALPN is now supported on all
platforms.SecurityContext: added withTrustedRoots named optional parameter
constructor, which defaults to false.timeout parameter to Socket.connect, RawSocket.connect,
SecureSocket.connect and RawSecureSocket.connect. If a connection attempt
takes longer than the duration specified in timeout, a SocketException
will be thrown. Note: if the duration specified in timeout is greater than
the OS level timeout, a timeout may occur sooner than specified in timeout.Stdin.hasTerminal added, which is true if stdin is attached to a terminal.WebSocket added static userAgent property.RandomAccessFile.close returns Future<void>IOOverrides.socketConnect.ZLibOptions, FileMode, FileLock,
FileSystemEntityType, FileSystemEvent, ProcessStartMode,
ProcessSignal, InternetAddressType, InternetAddress, SocketDirection,
SocketOption, RawSocketEvent, and StdioType, and deprecated the old
SCREAMING_CAPS constants.zlib, gzip, and
systemEncoding, and deprecated the old SCREAMING_CAPS top-level constants.FileMode constants READ, WRITE, APPEND,
WRITE_ONLY, and WRITE_ONLY_APPEND. Please use e.g. FileMode.read
instead.X509Certificate.der, X509Certificate.pem, and
X509Certificate.sha1.FileSystemEntity.fromRawPath constructor to allow for the creation of
FileSystemEntity using Uint8List buffers.HttpStatus, HttpHeaders,
ContentType, HttpClient, WebSocketStatus, CompressionOptions, and
WebSocket. The SCREAMING_CAPS constants are marked deprecated. Note that
HttpStatus.CONTINUE is now HttpStatus.continue_, and that e.g.
HttpHeaders.FIELD_NAME is now HttpHeaders.fieldNameHeader.Platform.packageRoot, which is only used for packages/
directory resolution which is no longer supported. It will now always return
null, which is a value that was always possible for it to return previously.HttpClient.connectionTimeout.{Socket,RawSocket,SecureSocket}.startConnect. These return a
ConnectionTask, which can be used to cancel an in-flight connection attempt.dart:isolateIsolate.spawn take a type parameter representing the argument type of
the provided function. This allows functions with arguments types other than
Object in strong mode.IMMEDIATE and BEFORE_NEXT_EVENT on Isolate to immediate and
beforeNextEvent.Isolate.packageRoot, which is only used for packages/ directory
resolution which is no longer supported. It will now always return null, which
is a value that was always possible for it to return previously.packageRoot parameter in Isolate.spawnUri, which is was
previously used only for packages/ directory resolution. That style of
resolution is no longer supported in Dart 2.<!-- Still need entries for all changes to dart:js since 1.x -->
dart.mathE, LN10, LN, LOG2E, LOG10E, PI, SQRT1_2 and SQRT2 to
e, ln10, ln, log2e, log10e, pi, sqrt1_2 and sqrt2.dart.mirrorsIsolateMirror.loadUri, which allows dynamically loading additional
code.MirrorsUsed as deprecated. The MirrorsUsed annotation was only used
to inform the dart2js compiler about how mirrors were used, but dart2js no
longer supports the mirrors library altogether.<!-- Still need entries for all changes to dart:svg since 1.x -->
dart:typed_dataUnmodifiable view classes over all List types.BYTES_PER_ELEMENT to bytesPerElement on all typed data lists.XXXX through WWWW on Float32x4 and Int32x4 to
lower-case xxxx through wwww.Endinanness to Endian and its constants from BIG_ENDIAN,
LITTLE_ENDIAN and HOST_ENDIAN to little, big and host.<!-- Still need entries for all changes to dart:web_audio,web_gl,web_sql since 1.x -->
Support for MIPS has been removed.
Dart int is now restricted to 64 bits. On overflow, arithmetic operations
wrap around, and integer literals larger than 64 bits are not allowed. See
https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md
for details.
The Dart VM no longer attempts to perform packages/ directory resolution
(for loading scripts, and in Isolate.resolveUri). Users relying on
packages/ directories should switch to .packages files.
Expose JavaScript Promise APIs using Dart futures. For example,
BackgroundFetchManager.get is defined as:
Future<BackgroundFetchRegistration> get(String id)
It can be used like:
BackgroundFetchRegistration result = await fetchMgr.get('abc');
The underlying JS Promise-to-Future mechanism will be exposed as a public API in the future.
dartdevc will no longer throw an error from is checks that return a
different result in weak mode (SDK issue 28988). For example:
main() {
List l = [];
// Prints "false", does not throw.
print(l is List<String>);
}
Failed as casts on Iterable<T>, Map<T>, Future<T>, and Stream<T> are
no longer ignored. These failures were ignored to make it easier to migrate
Dart 1 code to strong mode, but ignoring them is a hole in the type system.
This closes part of that hole. (We still need to stop ignoring "as" cast
failures on function types, and implicit cast failures on the above types and
function types.)
dart2js now compiles programs with Dart 2.0 semantics. Apps are expected to be
bigger than before, because Dart 2.0 has many more implicit checks (similar to
the --checked flag in Dart 1.0).
We exposed a --omit-implicit-checks flag which removes most of the extra
implicit checks. Only use this if you have enough test coverage to know that
the app will work well without the checks. If a check would have failed and it
is omitted, your app may crash or behave in unexpected ways. This flag is
similar to --trust-type-annotations in Dart 1.0.
dart2js replaced its front-end with the common front-end (CFE). Thanks to the CFE, dart2js errors are more consistent with all other Dart tools.
dart2js replaced its source-map implementation. There aren't any big differences, but more data is emitted for synthetic code generated by the compiler.
dart:mirrors support was removed. Frameworks are encouraged to use
code-generation instead. Conditional imports indicate that mirrors are not
supported, and any API in the mirrors library will throw at runtime.
The generated output of dart2js can now be run as a webworker.
dart:isolate support was removed. To launch background tasks, please use
webworkers instead. APIs for webworkers can be accessed from dart:html or
JS-interop.
dart2js no longer supports the --package-root flag. This flag was deprecated
in favor of --packages long ago.
The analyzer will no longer issue a warning when a generic type parameter is used as the type in an instance check. For example:
test<T>() {
print(3 is T); // No warning
}
New static checking of @visibleForTesting elements. Accessing a method,
function, class, etc. annotated with @visibleForTesting from a file not in
a test/ directory will result in a new hint (issue 28273).
Static analysis now respects functions annotated with @alwaysThrows (issue
31384).
New hints added:
NULL_AWARE_BEFORE_OPERATOR when an operator is used after a null-aware
access. For example:
x?.a - ''; // HINT
NULL_AWARE_IN_LOGICAL_OPERATOR when an expression with null-aware access
is used as a condition in logical operators. For example:
x.a || x?.b; // HINT
The command line analyzer (dartanalyzer) and the analysis server no longer
treat directories named packages specially. Previously they had ignored
these directories - and their contents - from the point of view of analysis.
Now they'll be treated just as regular directories. This special-casing of
packages directories was to support using symlinks for package: resolution;
that functionality is now handled by .packages files.
New static checking of duplicate shown or hidden names in an export directive (issue 33182).
The analysis server will now only analyze code in Dart 2 mode ('strong mode').
It will emit warnings for analysis options files that have
strong-mode: false set (and will emit a hint for strong-mode: true, which
is no longer necessary).
The dartanalyzer --strong flag is now deprecated and ignored. The
command-line analyzer now only analyzes code in strong mode.
Support assert() in const constructor initializer lists.
Better formatting for multi-line strings in argument lists.
Force splitting an empty block as the then body of an if with an else.
Support metadata annotations on enum cases.
Add --fix to remove unneeded new and const keywords, and change : to
= before named parameter default values.
Change formatting rules around static methods to uniformly format code with
and without new and const.
Format expressions inside string interpolation.
Pub has a brand new version solver! It supports all the same features as the old version solver, but it's much less likely to stall out on difficult package graphs, and it's much clearer about why a solution can't be found when version solving fails.
Remove support for transformers, pub build, and pub serve. Use the [new
build system][transformers] instead.
There is now a default SDK constraint of <2.0.0 for any package with no
existing upper bound. This allows us to move more safely to 2.0.0. All new
packages published on pub will now require an upper bound SDK constraint so
future major releases of Dart don't destabilize the package ecosystem.
All SDK constraint exclusive upper bounds are now treated as though they allow
pre-release versions of that upper bound. For example, the SDK constraint
>=1.8.0 <2.0.0 now allows pre-release SDK versions such as 2.0.0-beta.3.0.
This allows early adopters to try out packages that don't explicitly declare
support for the new version yet. You can disable this functionality by setting
the PUB_ALLOW_PRERELEASE_SDK environment variable to false.
Allow depending on a package in a subdirectory of a Git repository. Git
dependencies may now include a path parameter, indicating that the package
exists in a subdirectory of the Git repository. For example:
dependencies:
foobar:
git:
url: git://github.com/dart-lang/multi_package_repo
path: pkg/foobar
Added an --executables option to pub deps command. This will list all
available executables that can be run with pub run.
The Flutter sdk source will now look for packages in
flutter/bin/cache/pkg/ as well as flutter/packages/. In particular, this
means that packages can depend on the sky_engine package from the sdk
source (issue 1775).
Pub now caches compiled packages and snapshots in the .dart_tool/pub
directory, rather than the .pub directory (issue 1795).
Other bug fixes and improvements.
dart:collection: SplayTree added the toSet function.
dart:collection: SplayTree added the toSet function.
dart:convert: The JsonUtf8Encoder class was added.
dart:core:
The IndexError class was added for errors caused by an index being outside
its expected range.
The new RangeError.index constructor was added. It forwards to
new IndexError.
RangeError added three new properties. invalidProperty is the value that
caused the error, and start and end are the minimum and maximum values
that the value is allowed to assume.
new RangeError.value and new RangeError.range added an optional
message argument.
The new String.fromCharCodes constructor added optional start and end
arguments.
dart:io:
Support was added for the Application-Layer Protocol Negotiation extension to the TLS protocol for both the client and server.
SecureSocket.connect, SecureServerSocket.bind,
RawSecureSocket.connect, RawSecureSocket.secure,
RawSecureSocket.secureServer, and RawSecureServerSocket.bind added a
supportedProtocols named argument for protocol negotiation.
RawSecureServerSocket added a supportedProtocols field.
RawSecureSocket and SecureSocket added a selectedProtocol field which
contains the protocol selected during protocol negotiation.
streamListen requests to the VM service.- Update dependencies.
Add 30 second keep alive period for SSE connections.
Update package:vm_service to 6.0.1-nullsafety.0.
package:vm_service to 6.0.1-nullsafety.0.Return an RpcException error with code kServiceDisappeared if the VM service connection disappears with an outstanding forwarded request.
kServiceDisappeared if the VM
service connection disappears with an outstanding forwarded request.Fixed issue where a null JSON RPC result could be sent if the VM service disconnected with a request in flight (see https://github.com/flutter/flutter
Fixed issue where DartDevelopmentServiceException could have a null message.
Added errorCode to DartDevelopmentServiceException to communicate the underlying reason of the failure.
errorCode to DartDevelopmentServiceException to communicate the
underlying reason of the failure.Improve internal error handling for situations with less than graceful shutdowns.
Fixed issue where evaluate and evaluateInFrame requests were not being forwarded to the VM service properly when no external compilation service was r
evaluate and evaluateInFrame requests were not being
forwarded to the VM service properly when no external compilation service
was registered.Added done property to DartDevelopmentService.
done property to DartDevelopmentService.DartDeveloperServiceException when shutdown occurs during startup.StateError was thrown when DDS was shutdown with pending
requests.Fixed issue where clients subscribing to the Service stream were not being sent ServiceRegistered events on connection.
Service stream were not being
sent ServiceRegistered events on connection.Fixed issue where isolateIds were expected to take the form isolates/123 although this is not required by the VM service specification.
isolateIds were expected to take the form isolates/123
although this is not required by the VM service specification.Fixed issue where DartDevelopmentService.sseUri did not return a URI with a sse scheme.
DartDevelopmentService.sseUri did not return a URI with a
sse scheme.Fixed issue where an exception could be thrown during startup if the target process had an isolate without an associated pause event.
Added support for SSE connections from web-based clients.
Fixed another issue where a StateError could be raised within DartDevelopmentService when a client has disconnected after the target VM service has sh
StateError could be raised within DartDevelopmentService
when a client has disconnected after the target VM service has shutdown.Fixed issue where DDS was expecting a client provided implementation of compileExpression to return a response with two layers of response objects.
compileExpression to return a response with two layers of response objects.Fixed issue where a StateError could be raised within DartDevelopmentService when a client has disconnected after the target VM service has shutdown.
StateError could be raised within DartDevelopmentService
when a client has disconnected after the target VM service has shutdown.Fixed issue where evaluate and evaluateInFrame were not invoking client provided implementations of compileExpression.
evaluate and evaluateInFrame were not invoking client
provided implementations of compileExpression.Fixed issue where forwarding requests with no RPC parameters would return an RPC error.
Added getDartDevelopmentServiceVersion RPC.
getDartDevelopmentServiceVersion RPC.getSupportedProtocols response.jsonrpc parameter.- Initial release.
Your coding agent can read these notes before it upgrades. Set up the MCP server →