Pular para o conteúdo principal

Changelog do Dart

Um changelog completo do Dart.

Esta página lista o histórico completo de mudanças do Dart SDK e da linguagem Dart, organizado por versão. Usamos tags para classificar as mudanças, como New para recursos, Fixed para correções de bugs e Breaking para mudanças incompatíveis. Algumas mudanças são Language versioned, o que significa que só têm efeito quando você atualiza a versão da linguagem do seu código.

3.13

# Lançado em 2026-08-12
Language Primary constructors #
Novo Versionado por linguagem

Added primary constructors, a concise syntax for declaring a constructor and instance variables in a declaration header. This language feature requires a language version of 3.13 or later.

Language Parameter declarations #
Versionado por linguagem

You can no longer use final or var on non-declaring parameters. Dart now reserves both for declaring parameters in primary constructors. Remove final or var from affected parameter declarations. If you still want to prevent parameter reassignment, you can use the parameter_assignments lint rule.

Language Type promotion #
Breaking Corrigido

Breaking change: Updated type promotion rules to fix unsound behavior. For details, see SDK issue #62889.

Libraries dart:async #
Novo

Added Future.pause as an alternative to Future.delayed without a callback.

Libraries dart:core #
Novo

Added List.unmodifiableOf, providing stronger static typing than List.unmodifiable.

Libraries dart:core #
Novo

Added Map.unmodifiableOf, providing stronger static typing than Map.unmodifiable.

Libraries dart:core #
Novo

Added two getters on int for efficient bit counting: trailingZeroBitCount (ctz) and oneBitCount (popcount). On native platforms, they operate on the full 64-bit two's complement representation. On web targets, they operate on the least significant 32 bits. For details, see SDK issue #52673.

Libraries dart:io #
Corrigido

Fixed cookie date parsing to follow the permissive algorithm specified in the HTTP state management RFC. The parser now accepts non-standard date formats again, rather than restricting inputs to strictly formatted dates.

Libraries dart:io #
Corrigido

Behavioral change: File access and modification timestamps (File.lastModified, FileStat, lastAccessed, lastModified, setLastAccessed, and setLastModified) now preserve microsecond precision instead of truncating or rounding to millisecond accuracy. For details, see SDK issue #42444.

Libraries dart:io #
Breaking Novo

Breaking change: Added InterfaceAddress, a subtype of InternetAddress that exposes a prefixLength field and a broadcast getter for network interfaces. NetworkInterface.addresses now returns List<InterfaceAddress> instead of List<InternetAddress>. Classes implementing NetworkInterface and overriding addresses must update their return type accordingly. For details, see SDK issue #63216.

Libraries dart:io #
Alterado

InternetAddress.lookup no longer accepts non-standard IPv4 address formats historically accepted by inet_aton.

Libraries dart:isolate #
Novo

Added synchronous execution and event loop control APIs to Isolate: Isolate.runSync, Isolate.create, Isolate.shutdownSync, Isolate.pinToCurrentThread, Isolate.isPinnedToCurrentThread, Isolate.runEventLoopSync, Isolate.onEvent, and Isolate.handleEvent.

Libraries dart:js_interop #
Alterado

Made JSFunction and JSExportedDartFunction generic for increased static type safety. JSExportedDartFunction<T>.toDart now casts the wrapped function to type T, and isA<JSExportedDartFunction<T>> checks that the wrapped function is a T. The type argument T is otherwise purely descriptive; runtime types of JSFunction and JSExportedDartFunction remain unchanged. For details, see SDK issue #54557.

Libraries dart:js_interop #
Novo

Added JSObject.getPrototypeOf to dart:js_interop for retrieving JavaScript object prototypes.

Tools Analyzer #
Novo

Added LSP support for Inline Values (textDocument/inlineValue), allowing IDEs and debuggers to render inline variable evaluations during active debugging sessions.

Tools Analyzer #
Novo Experimental

Added custom LSP methods (dart/textDocument/getFlutterWidgetPreviews and dart/workspace/getFlutterWidgetPreviews) to serve Flutter Widget Preview metadata to editor clients.

Tools Analyzer #
Novo

Added custom LSP method dart/connectToDtd, enabling language server clients to pair the Analysis Server with the Dart Tooling Daemon (DTD).

Tools Analyzer #
Novo

Added the no_raw_types lint rule, replacing the strict-raw-types analysis option for more consistent type checking.

Tools Analyzer #
Novo

Added the no_dynamic_casts lint rule, replacing the strict-casts analysis option for more consistent type checking.

Tools Analyzer #
Descontinuado

Deprecated low-value lint rules avoid_private_typedef_functions and one_member_abstracts. To continue using these rules, re-implement them with analyzer plugins.

Tools Linter #
Novo

Added async_return_with_no_await lint rule, which warns on async functions returning a non-Future value without using await.

Tools Linter #
Novo

Added empty_container_bodies lint rule, which flags empty bodies in classes, enums, mixins, or extensions.

Tools Linter #
Novo

Added initialize_in_field_declaration lint rule, which recommends initializing fields at their declaration site where applicable.

Tools Linter #
Novo

Added unnecessary_const_in_enum_constructor lint rule, which flags redundant const keywords in enum constructors.

Tools Linter #
Novo

Added unnecessary_primary_constructor_body lint rule, which flags unnecessary or empty bodies on primary constructors.

Tools Linter #
Novo

Added unnecessary_type_name_in_constructor lint rule, which flags redundant explicit type names in constructor declarations.

Tools Linter #
Novo

Added use_declaring_parameters lint rule, which encourages declaring parameters in primary constructors.

Tools Linter #
Novo Experimental

Added experimental use_primary_constructors lint rule, which encourages adopting primary constructor syntax when primary constructors are enabled.

Tools Formatter #
Alterado

dart format --version --verbose now displays supported language versions.

Tools Formatter #
Corrigido

Fixed a crash in dart format when an analysis_options.yaml file includes a non-existent or unreadable file (dart_style #1840).

Tools Formatter #
Corrigido

Fixed an eager splitting optimization bug that caused collections or argument lists to split unnecessarily in rare cases (dart_style #1809).

Tools Formatter #
Corrigido

Prevented dart format from inserting an unwanted blank line before a comment at the end of a compilation unit or braced body (dart_style #1644).

Tools Formatter #
Corrigido

Formatted extension type representation clauses consistently with primary constructor formal parameter lists.

Tools Formatter #
Corrigido

Fixed formatting in enums with members so a newline is not inserted before the ; unless a trailing comma is present.

Tools Formatter #
Alterado Versionado por linguagem

Added trailing commas to split extension type representation clauses when formatting code at language version 3.13 or higher (dart_style #1845).

Tools Formatter #
Corrigido Versionado por linguagem

Fixed an eager splitting optimization bug that led the formatter to prefer suboptimal line splits (dart_style #1847).

Tools Formatter #
Alterado Versionado por linguagem

Improved formatting to prefer splitting call chains for single-element targets (dart_style #1732).

Tools Formatter #
Alterado Versionado por linguagem

Added support for block formatting parameter lists (dart_style #1693).

Tools Formatter #
Alterado Versionado por linguagem

Added support for block formatting as, is, and is! expressions (dart_style #1542).

Tools Formatter #
Alterado Versionado por linguagem

Updated dart format to separate imports into distinct sections (dart_style #1120).

Tools Formatter #
Alterado Versionado por linguagem

Updated dart format to split if-case guards when the associated pattern block-splits (dart_style #1596).

Tools Formatter #
Alterado Versionado por linguagem

When formatting code that exceeds page width limits, preferred solutions where overflowing lines end in string literals or comments (dart_style #1802, dart_style #1803, and dart_style #1837).

Tools Formatter #
Alterado Versionado por linguagem

Enforced blank lines around mixin and extension type declarations without a ; body.

Tools Pub #
Novo

Added dart pub workspace list to list all workspace packages and their directory paths, with support for --json output.

Tools Pub #
Novo

Added dart pub cache preload for installing packages directly into PUB_CACHE from .tar.gz archives.

Tools Dart CLI #
Novo

Added cross-compilation support to dart build cli via the --target-os and --target-arch flags.

Tools Dart CLI #
Alterado

Updated dart build and dart compile to support using locally built target binaries from a local SDK build directory (identified by build.ninja), avoiding downloads from Google Cloud Storage.

Dart Runtime #
Removido

Removed built-in fallback root certificates when system certificates are missing. Use --root-certs-file or --root-certs-cache options to provide certificates manually.

Dart Runtime C Embedder API #
Breaking

Breaking change: Updated Dart_FileModifiedCallback in dart_tools_api.h to pass int64_t since in microseconds since epoch instead of milliseconds, matching FileStat microsecond precision.

Dart Runtime C Embedder API #
Novo

Added Dart_SetCurrentThreadOwnsIsolate and Dart_GetCurrentThreadOwnsIsolate functions to dart_api.h and dart_api_dl.h, allowing custom embedders to bind and query isolate thread ownership.

3.12

# Lançado em 2026-05-18
Language Private named parameters #
Novo

Introduced support for private named parameters on initializing formals and primary constructor parameters. This feature allows constructors to accept named parameters that directly initialize private fields. The leading underscore is automatically omitted to determine the public parameter name at the call site.

Libraries dart:core #
Novo

The Dart VM RegExp implementation now supports modifier spans and duplicate named capture groups.

Libraries dart:js_interop #
Breaking

Moved isA from JSAnyUtilityExtension to NullableObjectUtilExtension to support type-checking any Object?. In addition, isA<JSObject>() correctly evaluates JS objects that lack prototypes, and isA<JSAny>() robustly verifies that a value is a valid JS value. Because NullableObjectUtilExtension applies to the broader Object? supertype rather than JSAny?, this migration is backwards-compatible for most code. This change breaks existing code only if you explicitly referenced the JSAnyUtilityExtension name by applying the extension directly or by importing it with show/hide directives.

Libraries dart:js_interop #
Alterado

isA<JSExportedDartFunction>() now checks whether the function is a JS wrapper function returned by Function.toJS or Function.toJSCaptureThis.

Libraries dart:js_interop #
Novo

Added JSIterableProtocol, JSIterable, JSIteratorProtocol, JSIterator, and JSIteratorResult types to model JavaScript's iteration protocols. JSArray and JSString now implement JSIterable.

Libraries dart:js_interop #
Novo

Added extension types to provide Iterable.toJSIterable, JSIterable.toDartIterable, Iterator.toJSIterator, and JSIterator.toDartIterator.

Tools Analyzer #
Novo

The new simple_directive_paths lint flags unnecessarily complex import and export paths, such as paths containing redundant ./ or backtracking ../ segments. The associated quick fix simplifies these paths automatically.

Use dart fix --code=simple_directive_paths (with either --dry-run or --apply) to bulk fix existing lint violations across your project.

Tools Analyzer #
Alterado

The prefer_initializing_formals lint rule now reports named parameters that qualify as private named parameters, if the package pubspec enables the language feature (for example, sdk: ^3.12.0).

Use dart fix --code=prefer_initializing_formals (with either --dry-run or --apply) to bulk fix existing lint violations.

Tools Analyzer #
Novo

dart fix now supports fixing avoid_final_parameters lint violations using dart fix --code=avoid_final_parameters (with either --dry-run or --apply).

Tools Analyzer #
Alterado

The analyzer now warns when tearing off a function that has a @mustBeConst annotated parameter.

Tools Analyzer #
Alterado

The invalid_runtime_check_with_js_interop_types rule now checks for JS interop types within catch clauses and instructs you to use isA for type checks instead.

Tools Analyzer #
Novo

Added initial support for 'print debugging' via new sections in the "Plugins" Insights (Diagnostics) page. When a plugin computes lint and warning diagnostics, the analysis server now redirects print calls and presents the messages in the appropriate plugin's section on the Plugins page.

Tools Analyzer #
Alterado

Improved support for extension types in many existing lint rules.

Tools Analyzer #
Alterado

Improved support for null-aware elements in existing lint rules.

Tools Analyzer #
Alterado

The analysis server starts up faster due to improved caching of analysis options files. The exact speedup depends on the number of analysis options files in your workspace and the number of included files, with the greatest improvements seen on systems with slower disk access.

Tools Pub #
Alterado

dart pub cache repair now by default only repairs the packages referenced by your current project's pubspec.lock. To repair all packages, use the --all flag.

Tools Pub #
Alterado

dart pub add and dart pub unpack now accept @ as an alternative to : for separating a package name from its version constraint.

Tools Pub #
Novo

Git dependencies now support LFS.

Tools dart2wasm #
Alterado

Updated the deferred loading module loader API to support batched fetching of deferred modules. The embedder now uses loadDeferredModules instead of loadDeferredModule. This new callback accepts an array of module names rather than a single module name. In addition, all module loading functions must accept an instantiator callback and pass the loaded results to it.

Tools dart2js #
Corrigido

JSExportedDartFunction.toDart sometimes incorrectly returned the original Dart function even if the wrapper JS function was cast from a call to the deprecated allowInterop. To be consistent with DDC and dart2wasm, it now throws if the wrapper JS function wasn't a result of Function.toJS or Function.toJSCaptureThis.

3.11

# Lançado em 2026-02-11
Libraries dart:io #
Novo

Added support for Unix domain sockets (AF_UNIX) on Windows. Support is restricted to the subset of features supported by the OS. Windows currently does not support the following features for AF_UNIX sockets: datagram sockets, ancillary data, or abstract socket addresses. Unix domain sockets are represented in the filesystem using reparse points which leads to some discrepancies in the behavior of dart:io APIs: for example File(socketPath).existsSync() will return true on POSIX operating systems, but false on Windows. Use FileSystemEntity.typeSync() instead to get portable behavior.

Libraries dart:js_interop #
Novo

Added a constructor to JSSymbol, as well as JSSymbol.key, JSSymbol.description, and static methods for all well-known ECMAScript symbols.

Libraries dart:js_util #
Breaking Removido

dart2wasm no longer supports dart:js_util. Any code that imports dart:js_util will no longer compile with dart2wasm. Consequently, code that depends on package:js will no longer compile with dart2wasm either. The name dart.library.js_util is no longer a key in dart2wasm compilation environments, including in conditional imports and exports.

Tools Analyzer #
Alterado

The Insights pages (aka the "Analysis Server Diagnostics" pages) now show data regarding the "Message Scheduler."

Tools Analyzer #
Novo

The "Fix all in workspace" command now supports a progress indicator.

Tools Analyzer #
Alterado

Analysis via analyzer plugins is now faster on subsequent runs, as the analysis server will now re-use an existing AOT snapshot of the plugin's entrypoint. This saves a constant amount of time at the start of each IDE session and dart analyze run, on the order of 10 seconds.

Tools Analyzer #
Corrigido

Various fixes were made for the call method on a Function object, like "go to definition," and completion.

Tools Analyzer #
Corrigido

Various fixes were made for the error and stackTrace parameters of try/catch statements.

Tools Analyzer #
Corrigido

Various fixes were made for syntax highlighting, navigation, code completion, hovers, quick fixes, assists, "rename" refactoring, and "go to imports."

Tools Analyzer #
Corrigido

Fixed various issues with support for the "dot shorthands" syntax in IDEs.

Tools Analyzer #
Corrigido

Implemented LSP format-on-type improvements to not format in undesirable cases.

Tools Analyzer #
Corrigido

Fixes to the "Extract Widget" refactoring.

Tools Analyzer #
Novo

A new lint rule was added: simplify_variable_pattern, which encourages using the pattern shorthand for variables and property names of the same name.

Tools Analyzer #
Descontinuado

The avoid_null_checks_in_equality_operators lint rule is now deprecated.

Tools Analyzer #
Descontinuado

The prefer_final_parameters lint rule is now deprecated.

Tools Analyzer #
Descontinuado

The use_if_null_to_convert_nulls_to_bools lint rule is now deprecated.

Tools Dart development compiler (dartdevc) #
Alterado

The async timing of the Future returned by deferred_prefix.loadLibrary() is now consistent regardless of whether 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.

Tools Pub #
Novo Versionado por linguagem

"Glob" support has been added for pub workspaces. Now to include all packages inside pkgs/ in the workspace, simply write:

yaml
workspace:
  - pkgs/*

Supported if the Dart SDK constraint of the containing package is 3.11.0 or higher.

Tools Pub #
Novo

Added the new command dart pub cache gc for reclaiming disk space from your pub cache. It works by removing packages from your pub cache that are not referenced by any of your current projects.

Tools Pub #
Novo

When running a dry run of dart pub publish with the --dry-run flag, you can now ignore warnings with the --ignore-warnings flag.

When you specify this flag, the dry run will only exit with a non-zero exit code if package validation has errors.

SDK Platform updates #
Alterado

Added support for Unix domain sockets on Windows in dart:io. Also removed support for dart:js_util in dart2wasm, requiring migration to dart:js_interop.

Tools Wasm compilation #
Removido Breaking

Code that imports dart:js_util or package:js now results in a compilation error when compiling to WebAssembly. Invoking any API from these libraries will result in a runtime error. Usages should be migrated to dart:js_interop and dart:js_interop_unsafe.

3.10

# Lançado em 2025-11-12
Language Dot shorthands #
Alterado

Introduced dot shorthands for enums and other static members, allowing you to omit the type name when the context makes it clear. It also improves type inference for sync* and async* generator functions, eliminating spurious null from their return types. The analyzer now supports a new plugin system for custom rules and quick fixes, and several new lints and assists have been added. Additionally, the Dart CLI has been split from the Dart VM into a separate executable.

Language Generator functions #
Corrigido

sync* and async* generator functions without a specified return now correctly infer return types as non-nullable when no null value is yielded. This might trigger new diagnostics related to unnecessary code elements, such as an unnecessary null-aware access operator (?.).

Libraries dart:core #
Corrigido

The Uri.parseIPv4Address and Uri.parseIPv6Address functions no longer incorrectly allow leading zeros in IPv4 addresses.

Libraries dart:core #
Descontinuado

The ability to implement RegExp and RegExpMatch is deprecated and will be removed in a future release.

Libraries dart:io #
Descontinuado

IOOverrides can no longer be implemented, but can still be extended.

Libraries dart:js_interop #
Alterado

The Uint16ListToJSInt16Array extension has been renamed to Uint16ListToJSUint16Array.

Libraries dart:js_interop #
Alterado

The JSUint16ArrayToInt16List extension has been renamed to JSUint16ArrayToUint16List.

Libraries dart:js_interop #
Alterado

The Function.toJSCaptureThis function now results in addditional compile-time checks to match Function.toJS. If the function doesn't have a statically known type, has unsupported types in its signature, includes type parameters, or has any named parameters, the call will result in a compile-time error.

Tools SDK #
Alterado

The dart CLI and Dart VM are now separate executables, with the pure Dart VM executable and process called dartvm. Dart programs should still be run with dart run.

Tools SDK #
Alterado

Subcommands of the dart tool, such as dart format and dart compile now run AOT-compiled snapshots of the underlying tools. There should be no functional difference outside of performance improvements, but if you come across incompatibilities, please report them.

Tools SDK #
Removido Breaking

The dart tool is no longer available for IA32 platforms as the Dart SDK no longer supports IA32.

Tools Analyzer #
Alterado

Using members marked as @experimental outside the package they are declared in now results in a warning.

Tools Analyzer #
Alterado

Lint rules enabled in included analysis options files now result in incompatible lint diagnostics when appropriate.

Tools Analyzer #
Removido Breaking

The deprecated @required annotation from package:meta is no longer supported. To mark a parameter as required, instead use the required keyword.

Tools Wasm compilation #
Removido Breaking

dart:js_util and package:js are no longer supported when compiling to WebAssembly. Invoking any API from these libraries will result in a runtime error. Usages should be migrated to dart:js_interop and dart:js_interop_unsafe.

Tools Wasm compilation #
Alterado

To match the JS compilers, dartify when compiled to Wasm, now converts JS Promise objects to Dart Future objects instead of Dart JSValue objects.

3.9

# Lançado em 2025-08-13
3.9.4 Tools Pub #
Corrigido

Lançado em: 2025-09-30

dart pub get --example now resolves example/ folders across the entire workspace, not only in the root package. This fixes an issue where flutter pub get could crash if examples had not been resolved before resolving the workspace.

3.9.3 Tools Development JavaScript compiler (DDC) #
Corrigido

Lançado em: 2025-09-09

This patch release fixes a performance regression in modular builds where static calls are deeply nested within a closure.

3.9.2 Tools Development JavaScript compiler (DDC) #
Corrigido

Lançado em: 2025-08-27

This patch release fixes an issue in DDC where static getters could be unintentionally invoked during a hot reload.

3.9.1 SDK DevTools, ARM32, git dependencies #
Alterado

Lançado em: 2025-08-20

This patch release fixes issues in DevTools, ARM32 compilation, and git dependencies using tag_pattern.

SDK Type promotion #
Alterado

Dart's type system now assumes null safety for type promotion, reachability, and definite assignment. The analysis server is now AOT compiled for improved performance. New lints switch_on_type and unnecessary_unawaited were added, along with a new @awaitNotRequired annotation.

Language Null safety #
Versionado por linguagem Alterado

Null safety is now assumed when computing type promotion, reachability, and definite assignment. As a result, improved dead code analysis might cause new analyzer diagnostics to trigger on existing code that previously passed analysis.

Tools Command line #
Alterado

Some subcommands of the dart tool, such as dart analyze and dart fix now run AOT-compiled snapshots of the underlying tools. There should be no functional difference outside of performance improvements, but if you come across incompatibilities, please report them.

Tools Pub #
Versionado por linguagem Corrigido Novo

The upper bound of the flutter SDK constraint in your workspace's root package is now respected. If your current SDK doesn't meet the specified bound, dart pub get and other actions that retrieve dependencies will fail.

Tools Dart build #
Experimental

Building a CLI app bundle with experimental native asset support now requires using the dart build cli subcommand and specifying the app entrypoint with a new --target option.

3.8

# Lançado em 2025-05-20
3.8.3 SDK DevTools, Hot Restart #
Alterado

Lançado em: 2025-07-31

This patch release fixes issues with the DevTools Network screen and Hot Restart.

3.8.2 SDK Dart2Wasm #
Alterado

Lançado em: 2025-07-16

This patch release fixes an issue with the size of cross-compiled binaries.

3.8.1 SDK DDC #
Alterado

Lançado em: 2025-05-28

This patch release fixes an issue in DDC with late variables being incorrectly captured within async function bodies.

SDK Null-aware elements #
Alterado

Introduced null-aware elements for collections, making it easier to conditionally add elements based on nullability. Also added Iterable.withIterator, HttpClientBearerCredentials, and various analyzer improvements including new quick fixes and lints.

Language Collections #
Novo

Added support for null-aware elements in collection literals. A null-aware element evaluates an expression and, if the result is not null, inserts the value into the surrounding collection.

Libraries dart:html #
Removido Breaking

The Element.created constructor has been removed.

Libraries dart:html #
Descontinuado

Native classes in dart:html, such as HtmlElement, can no longer be extended.

Tools Analyzer #
Descontinuado

The avoid_null_checks_in_equality_operators lint rule is deprecated and should be removed from analysis_options.yaml files.

Tools Development JavaScript compiler #
Alterado

Now throws a runtime error when a redirecting factory constructor is torn off and one of its optional non-nullable parameters is provided no value. In the future this is likely to be a compile-time error.

Tools Production JavaScript compiler #
Experimental Removido Breaking

The --experiment-new-rti and --use-old-rti flags are no longer supported.

Tools Formatter #
Versionado por linguagem Alterado Corrigido Novo

The formatter builds on the previous release's rewrite, incorporating feedback, bug fixes, and further enhancements. It now intelligently automates trailing comma placement, deciding whether to split constructs rather than forcing them. The update also includes style changes to tighten and improve code output.

3.7

# Lançado em 2025-02-12
3.7.3 SDK Analysis server #
Alterado

Lançado em: 2025-04-16

This patch release fixes a performance regression in the analysis server.

3.7.2 SDK dart2wasm #
Alterado

Lançado em: 2025-03-12

This patch release fixes a bug in dart2wasm related to js-string builtin functions with non-nullable parameter types.

3.7.1 SDK DevTools, DDC, CFE #
Alterado

Lançado em: 2025-02-26

This patch release fixes bugs in the DevTools network profiler, DDC factory constructors with generic local functions, and wildcard variable marking in the CFE.

SDK Wildcard variables #
Alterado

Introduced wildcard variables, a new "tall" style for the dart formatter, and officially deprecated older web libraries in favor of package:web and dart:js_interop. Also implemented numerous analyzer improvements and new lints.

Language Wildcard variables #
Versionado por linguagem Alterado Novo

Wildcard variables are now supported. A wildcard variable is a local variable or parameter named _. Wildcard variables are non-binding, so they can be declared multiple times without collisions. For example:

dart
Foo(_, this._, super._, void _()) {}
Language Type promotion #
Alterado

Reachability analysis now accounts for if a field is type promoted to Null using is or as. This makes the type system more self-consistent, because it mirrors the behavior of promoted local variables. This change isn't expected to make any difference in practice.

Libraries Web libraries #
Descontinuado

The dart:html, dart:indexed:db, dart:svg, dart:web_audo, dart:web_gl, and dart:js libraries are officially deprecated. They are expected to be removed in a future release. Project should migrate to use package:web and dart:js_interop. To learn more, check out Migrate to package:web.

Libraries JS Interop #
Descontinuado

The dart:js, dart:js_util, and package:js libraries are officially deprecated. They are expected to be removed in a future release. Projects should migrate to use dart:js_interop. To learn more, check out JS interop usage.

Tools Analyzer #
Removido Breaking

The package_api_docs and unsafe_html lint rules have been removed and should be removed from analysis_options.yaml files.

Tools Formatter #
Versionado por linguagem Alterado

The dart format command is now tied to the language version as of 3.7. If the language version of an input file is 3.7 or later, the code is formatted with the new tall style.

The new style looks similar to the style you get when you add trailing commas to argument lists, except that now the formatter will add and remove those commas for you. When an argument or parameter lists splits, it is formatted like so:

dart
longFunction(
  longArgument,
  anotherLongArgument,
);
Tools Formatter #
Removido Breaking

The --fix flag for dart format is no longer supported. To apply similar fixes and more, configure your analysis options and run dart fix.

Tools Formatter #
Descontinuado

The --line-length option for dart format has been deprecated and set to be removed. All usages should be migrated to the new --page-width option.

3.6

# Lançado em 2024-12-11
3.6.2 SDK HttpServer, Dart Format, DevTools, Dart Fix #
Alterado

Lançado em: 2025-01-30

This patch release fixes bugs in HttpServer response encoding, dart format parsing of digit separators, DevTools analytics, and dart fix application.

3.6.1 SDK Pub get, dart2wasm, analysis options #
Alterado

Lançado em: 2025-01-08

This patch release fixes issues with pub get in workspaces, AOT/dart2wasm compilation crashes, and analysis options discovery in workspaces.

SDK Digit separators #
Alterado

Introduced digit separators for number literals, improved throw expression type inference, and added support for pub workspaces. Also added new JSArray constructors and methods in dart:js_interop, and several new lints and assists.

Language Digit separators #
Novo

Added support for digit separator underscores (_) to the language. Digit separators improve readability of long number literals.

dart
var m = 1__000_000__000_000__000_000;
Language Type inference #
Alterado

The context used by Dart to perform type inference on the operand of a throw expression has been changed from the "unknown type" to Object. This makes the type system more self-consistent, because it reflects the fact that it's not legal to throw null. This change isn't expected to make any difference in practice.

Libraries dart:io #
Removido Breaking

The Platform() constructor has been removed. All instantiations of Platform should be removed.

Libraries dart:io #
Alterado

HttpClient now responds to a redirect that's missing a "Location" header by throwing a RedirectException instead of a StateError.

Tools Analyzer #
Descontinuado

The package_api_docs and unsafe_html lint rules have been deprecated and are set to be removed in Dart 3.7.

Tools Compiler front end #
Alterado

The Dart compiler now computes the upper and lower closures of type schemas just before they're passed into the subtype testing procedure. Before Dart 3.6, the compiler computed them at the very beginning of the upper and lower-bound computations. The analyzer already followed this behavior, so apps that already pass analysis are unlikely to be affected by this change.

Tools Wasm compiler #
Alterado

The condition dart.library.js is now false on conditional imports when compiling to WebAssembly. The dart.library.js_interop condition should be used instead.

Tools Formatter #
Alterado

The following changes might result in small formatting changes when running dart format with a Dart 3.6 SDK or later:

Tools Formatter #
Alterado

Preserve type parameters on old-style function-typed formals that also use this. or super..

Tools Formatter #
Corrigido

Correctly format imports with both as and if clauses.

Tools Pub #
Alterado

dart pub publish now warns if files that are tracked in git have uncommitted changes.

3.5

# Lançado em 2024-08-06
3.5.3 SDK DevTools #
Alterado

Lançado em: 2024-09-11

This patch release fixes issues with DevTools memory tool OOMs, missing tab bars in IntelliJ/Android Studio, and persistent release notes.

3.5.2 SDK Dart VM #
Alterado

Lançado em: 2024-08-28

This patch release fixes bugs in ZLibDecoder, running dart from PATH, and analysis server context roots in multi-package workspaces.

3.5.1 SDK Dart2Wasm #
Alterado

Lançado em: 2024-08-14

This patch release fixes issues with include: in analysis_options.yaml, wasm source maps, and several dart2wasm compiler bugs.

SDK Sound null safety only #
Alterado

Aligned type inference for await and if-null expressions with the analyzer. Also updated dart:core DateTime on web to store microseconds, made SecurityContext final, and removed unsound null safety support in the VM.

Language Type inference #
Alterado Novo

When the context for an await expression is dynamic, the context for the operand of expression is now FutureOr<_>. This has been changed to match the behavior of the analyzer.

Language Type inference #
Alterado Novo

When the context for an entire if-null expression (e1 ?? e2) is dynamic, the context for e2 is now the static type of e1. This has been changed to match the behavior of the analyzer. The old behavior can be restored by supplying explicit types.

Libraries dart:core #
Alterado

DateTime now stores microseconds on the web platform, more closely matching the behavior on native platforms.

Libraries dart:io #
Alterado

SecurityContext is now final and can no longer be subclassed.

Libraries dart:js_interop #
Alterado

importModule now accepts a JSAny instead of a String to support other JS values as well, such as TrustedScriptURL objects.

Libraries dart:js_interop #
Alterado

isTruthy and not now return JSBoolean instead of bool to be consistent with other JS operator methods.

Libraries dart:js_interop #
Alterado

ExternalDartReference no longer implements Object. Instead, it now accepts a type parameter (T) with a bound of Object? to capture the type of the Dart object that is externalized.

Libraries dart:typed_data #
Removido Breaking

The unmodifiable view classes for typed data have been removed. Instead of using the constructors of these classes, use the new asUnmodifiableView methods on typed data lists.

Dart Runtime Sound null safety only #
Removido Breaking

The Dart VM no longer supports unsound null safety.

  • The --no-sound-null-safety CLI option has been removed.
  • The Dart_NewListOf and Dart_IsLegacyType functions have been removed from the C API.
Dart Runtime C API #
Removido Breaking

The Dart_DefaultCanonicalizeUrl function has been removed from the C API.

3.4

# Lançado em 2024-05-14
3.4.4 SDK Dart2Wasm #
Alterado

Lançado em: 2024-06-12

This patch release fixes issues with pub advisory fetching, dart.library.ffi conditional imports in dart2wasm, and variadic arguments on MacOS Arm64 FFI.

3.4.3 SDK Dart2Wasm #
Alterado

Lançado em: 2024-06-05

This patch release fixes bugs in dart compile exe DART_VM_OPTIONS parsing, dart2wasm array.new_fixed() limits, and adds --enable-experiment support to dart2wasm.

3.4.2 SDK Dart2Wasm #
Alterado

Lançado em: 2024-05-29

This patch release marks dart compile wasm as stable. It also fixes bugs in dart2wasm exception handling, this restoration in async functions, and implements missing control flow constructs.

3.4.1 SDK CFE #
Alterado

Lançado em: 2024-05-22

This patch release fixes a CFE bug affecting Flutter web apps compiled with dart2wasm and a pub client bug interfering with Flutter l10n.

SDK Type analysis #
Alterado

Improved type analysis for conditional expressions, if-null, and switch expressions. Also added ExternalDartReference to dart:js_interop, deprecated unmodifiable typed data views, and removed waitFor from dart:cli.

Language Type analysis #
Alterado

Added improvements to the type analysis of conditional expressions, if-null expressions and assignments, and switch expressions.

Language Patterns #
Alterado

The pattern context type schema for cast patterns is now _ (the unknown type) instead of Object?.

Language Type inference #
Alterado

The type schema used by the Dart compilers to perform type inference on the operand of a null-aware spread operator (...?) in map and set literals has been made nullable, to match what currently happens in list literals.

Libraries dart:cli #
Experimental Removido Breaking

The waitFor function has been removed.

Libraries dart:html, dart:indexed:db, dart:svg, dart:web_audo, dart:web_gl #
Descontinuado

These libraries are now marked as legacy and will see less support in the future. New projects should prefer to use package:web and dart:js_interop. To learn more, check out Migrate to package:web.

Libraries dart:js #
Descontinuado

This library is now marked as legacy and will see less support in the future. Usages should be migrated to dart:js_interop and dart:js_interop_unsafe. To learn more, check out /go/next-gen-js-interop.

Libraries dart:js_util #
Descontinuado

This library is now marked as legacy and will see less support in the future. Usages should be migrated to dart:js_interop and dart:js_interop_unsafe. To learn more, check out /go/next-gen-js-interop.

Libraries dart:io #
Novo Alterado

Stdout has a new field lineTerminator, which allows developers to control the line ending used by stdout and stderr. Classes that implement Stdout must define the lineTerminator field. The default semantics of stdout and stderr are not changed.

Libraries dart:io #
Descontinuado

The FileSystemDeleteEvent.isDirectory property. It always returns false.

Libraries dart:typed_data #
Descontinuado

The unmodifiable view classes for typed data are deprecated. Instead of using the constructors of these classes, use the new asUnmodifiableView methods on typed data lists.

Tools Production JavaScript compiler #
Experimental Descontinuado

You should now specify a format to the --dump-info CLI option of either binary or json. The json format is deprecated and might be removed in a future Dart release.

Tools Wasm compiler #
Experimental

Various dart compile wasm CLI arguments have been updated, removed, or replaced. To learn more, run dart compile wasm --verbose --help.

Dart Runtime Dart VM #
Removido Breaking

The Dart VM no longer supports external strings. As a result, the Dart_IsExternalString, Dart_NewExternalLatin1String, and Dart_NewExternalUTF16String functions have been removed from the Dart C API.

3.3

# Lançado em 2024-02-15
3.3.4 SDK Dart2Wasm #
Alterado

Lançado em: 2024-04-17

This patch release fixes an issue with JS interop in dart2wasm where @JS annotations on enclosing libraries were incorrectly used.

3.3.3 SDK Dart VM #
Alterado

Lançado em: 2024-03-27

This patch release fixes a Dart VM crash on older Windows CPUs lacking SSE4.1.

3.3.2 SDK CFE #
Alterado

Lançado em: 2024-03-20

This patch release fixes bugs in the CFE related to incremental compilation crashes and redirecting factories in extension types, and a VM issue with DateTime.timeZoneName on Windows.

3.3.1 SDK Dart2js #
Alterado

Lançado em: 2024-03-06

This patch release fixes a dart2js issue with object literal constructors in interop extension types and disallows certain extension types in await expressions.

SDK Extension types #
Alterado

Introduced extension types for zero-cost wrappers, improved private field promotion, and added new features to dart:ffi and dart:js_interop, including Native.addressOf and importModule.

SDK Experiments #
Experimental Removido Breaking

The following experiments are now retired as they were released in Dart 3 and are no longer necessary with a language version of 3.0 or greater. Configuration of them should be removed from analysis options, CLI commands, and IDE configurations.

  • patterns
  • records
  • class-modifers
  • sealed-class
Language Extension types #
Novo

Added support for extension types. Extension types are a new feature in Dart that allow zero-cost wrapping of an existing type. They are similar to wrapper classes and extension methods, but with implementation differences and different tradeoffs.

dart
extension type Meters(int value) {
  String get label => '${value}m';
  Meters operator +(Meters other) => Meters(value + other.value);
}
​
void main() {
  var m = Meters(42); // Has type `Meters`.
  var m2 = m + m; // OK, type `Meters`.
  // int i = m; // Compile-time error, wrong type.
  // m.isEven; // Compile-time error, no such member.
  assert(identical(m, m.value)); // Succeeds.
}
Language Private field promotion #
Alterado

Abstract getters are now promotable under the rules of private final field promotion, if there are no conflicting declarations.

Libraries dart:cli #
Experimental Descontinuado

The waitFor function remains deprecated for another release and is set for removal in Dart 3.4.

Libraries dart:ffi #
Descontinuado

The elementAt pointer arithmetic methods on Pointer types are deprecated. Migrate to the - and + operators instead.

Libraries dart:ffi #
Experimental Removido Breaking

The previously deprecated @FfiNative annotation has been removed. Usages should be updated to use the @Native annotation.

Libraries dart:html #
Alterado

Instead of using HttpRequest directly, it is now recommended to use package:http.

Libraries dart:io #
Alterado

Instead of using HttpClient directly, it is now recommended to use package:http.

Libraries dart:js_interop #
Experimental

JS types like JSAny have new compiler-specific representation types.

Libraries dart:js_interop #
Experimental

User-defined @staticInterop classes can no longer implement JSAny or JSObject. Usages should be migrated to JSObject.fromInteropObject or be defined as extension types.

Libraries dart:js_interop #
Experimental

JSArray and JSPromise now have generic parameters.

Libraries dart:js_interop #
Experimental

Various extension members were moved or renamed. To learn about the updated extensions, reference JSAnyUtilityExtension and JSAnyOperatorExtension.

Libraries dart:typed_data #
Descontinuado Novo

The unmodifiable view classes for typed data will be deprecated in Dart 3.4. Instead of using the constructors of these classes, use the new asUnmodifiableView methods on typed data lists.

Libraries dart:nativewrappers #
Experimental

All native wrapper classes are now marked base so that none of their subtypes can be implemented.

Tools Production JavaScript compiler #
Descontinuado

The Invocation that is passed to noSuchMethod no longer has a minified memberName, even when compiled with --minify.

Tools Wasm compiler #
Experimental

Disallow importing legacy JS interop libraries. Prefer using dart:js_interop and dart:js_interop_unsafe instead.

Tools Analyzer #
Experimental

Invalid dart doc comment directives are now reported by the analyzer.

Tools Analyzer #
Alterado

Due to improvements in type promotion, the following analyzer diagnostics might trigger on existing code that previously passed analysis:

  • unnecessary_non_null_assertion
  • unnecessary_cast
  • invalid_null_aware_operator
Tools Linter #
Removido Breaking

The iterable_contains_unrelated_type and list_remove_unrelated_type lints were removed. Consider migrating to the expanded collection_methods_unrelated_type lint.

Tools Linter #
Removido Breaking

The following lints are removed due to no longer being necessary with sound null safety. You should remove configuration of them from your analysis_options.yaml files and any ignore comments.

  • always_require_non_null_named_parameters
  • avoid_returning_null
  • avoid_returning_null_for_future

3.2

# Lançado em 2023-11-15
3.2.3 SDK Dart VM #
Alterado

Lançado em: 2023-12-06

This patch release fixes issues with final fields in constant contexts, upgrades DevTools, and fixes AOT snapshot crashes on certain ARM/x86-64 CPUs.

3.2.2 SDK Analyzer #
Alterado

Lançado em: 2023-11-29

This patch release adjusts nullability computations in the upper bound algorithm and fixes missing closure code completion in LSP-based editors.

3.2.1 SDK Dart doc #
Alterado

Lançado em: 2023-11-22

This patch release fixes bugs in dart doc generation, JSON array parsing causing segfaults in flutter test, and upgrades DevTools.

SDK Private field promotion #
Alterado

Introduced private field promotion, allowing private final fields to be promoted to non-nullable types. Also included breaking changes to refutable patterns split points, disabled waitFor by default, and changed utf8.encode return type to Uint8List.

Language Private field promotion #
Novo

Expanded type promotion to work on private final fields. Previously only available for local variables and parameters, now private final fields can promote to non-nullable types through null checks and is tests. For example, the following code is now sound:

dart
class Example {
  final int? _privateField;
​
  Example(this._privateField);
​
  void f() {
    if (_privateField != null) {
      // _privateField has now been promoted; you can use it without
      // null checking it.
      int i = _privateField; // OK
    }
  }
}
​
// Private field promotions also work from outside of the class:
void f(Example x) {
  if (x._privateField != null) {
    int i = x._privateField; // OK
  }
}

For more information on when private final fields can and can't promote, check out Fixing type promotion failures.

Language Type promotion #
Versionado por linguagem Corrigido

Corrected inconsistencies in type promotion behavior of if-case statements where the value being matched against throws an exception.

Language Patterns #
Versionado por linguagem Corrigido

Changed the split point for refutable patterns to the top level pattern so type promotion in if-case statements is consistent regardless of whether the scrutinee might throw an exception.

Libraries dart:cli #
Experimental Descontinuado

Deprecated the waitFor function.

Libraries dart:convert #
Alterado

Changed return types of utf8.encode() and Utf8Codec.encode() from List<int> to Uint8List.

Libraries dart:developer #
Descontinuado

Deprecated the Service.getIsolateID method.

Libraries dart:ffi #
Alterado

Changed NativeCallable.nativeFunction so calls now throw an error if the receiver is already closed, instead of returning nullptr.

Libraries dart:io #
Alterado

Eliminated trailing whitespace from HTTP headers.

Libraries dart:io #
Alterado

Inserted a space at the fold point of folded header values that HttpClientResponse.headers and HttpRequest.headers return.

Libraries dart:js_interop #
Experimental Removido Breaking

JSNumber.toDart in favor of toDartDouble and toDartInt.

Libraries dart:js_interop #
Experimental Removido Breaking

Object.toJS in favor of Object.toJSBox.

Libraries dart:js_interop #
Alterado Experimental

Restricted external JS interop APIs using dart:js_interop to a set of allowed types.

Libraries dart:js_interop #
Alterado Experimental

Prohibited use of isNull and isUndefined on dart2wasm.

Libraries dart:js_interop #
Alterado Experimental

Changed typeofEquals and instanceof APIs to both return bool instead of JSBoolean. Also, typeofEquals now takes String instead of JSString.

Libraries dart:js_interop #
Alterado Experimental

Changed JSAny and JSObject types to only implementable, not extendable, by user @staticInterop types.

Libraries dart:js_interop #
Alterado Experimental

Changed JSArray.withLength to take int instead of JSNumber.

Tools Development JavaScript compiler #
Novo

Added interceptors for JavaScript Symbol and BigInt types; they should no longer be used with package:js classes.

Tools Production JavaScript compiler #
Novo

Added interceptors for JavaScript Symbol and BigInt types; they should no longer be used with package:js classes.

Tools Analyzer #
Versionado por linguagem Alterado

Private final field promotion might cause the following analyzer warnings to trigger on existing code that previously passed analysis:

dart
class C {
  final num? _x = null;
  void test() {
    if (_x != null) {
      print(_x! * 2); // unnecessary_non_null_assertion
      print(_x?.abs()); // invalid_null_aware_operator
    }
    if (_x is int) {
      print((_x as int).bitLength); // unnecessary_cast
    }
  }
}

3.1

# Lançado em 2023-08-16
3.1.5 SDK Dart2js #
Alterado

Lançado em: 2023-10-25

This patch release fixes an issue affecting Dart compiled to JavaScript running in Node.js 21.

3.1.4 SDK Dart VM #
Alterado

Lançado em: 2023-10-18

This patch release fixes a Dart VM issue where variable values were not visible while debugging.

3.1.3 SDK Dart2js #
Alterado

Lançado em: 2023-09-27

This patch release fixes a dart2js crash with @staticInterop factories, avoids symbol conflicts in the standalone VM, and fixes slow variable access during debugging.

3.1.2 SDK Dart2js #
Alterado

Lançado em: 2023-09-13

This patch release fixes a dart2js crash with typed record patterns in field initializers and fixes unhandled exception pauses in the debugger.

3.1.1 SDK Parser #
Alterado

Lançado em: 2023-09-07

This patch release fixes a parser bug that prevented nested record patterns from using destructuring shorthand syntax.

SDK dart:async, dart:io #
Alterado

Added breaking changes to dart:async and dart:io class modifiers, introduced NativeCallable for FFI, and made various updates to dart:core and dart:js_interop.

Libraries dart:async #
Novo

Added interface modifier to purely abstract classes: MultiStreamController, StreamConsumer, StreamIterator and StreamTransformer.

Libraries dart:io #
Novo

Added sameSite to the Cookie class, and added the class SameSite.

Libraries dart:io #
Descontinuado

FileSystemEvent is sealed. This means FileSystemEvent cannot be extended or implemented.

Libraries dart:js_interop #
Experimental Removido Breaking

ObjectLiteral; create an object literal with no named members using {}.jsify().

Libraries package:js #
Descontinuado

external @staticInterop members and external extension members can no longer be used as tear-offs. Declare a closure or a non-external method that calls these members, and use that instead.

Libraries package:js #
Descontinuado

external @staticInterop members and external extension members will generate slightly different JS code for methods that have optional parameters.

3.0

# Lançado em 2023-05-10
3.0.7 SDK Dart2js #
Alterado

Lançado em: 2023-07-26

This patch release fixes a dart2js bug causing TypeError or NoSuchMethodError when using records.

3.0.6 SDK Analyzer #
Alterado

Lançado em: 2023-07-12

This patch release fixes issues with flow analysis, infinite loops in web compiles involving records, and memory leaks in the analyzer.

3.0.5 SDK Frontend #
Alterado

Lançado em: 2023-06-14

This patch release fixes a bad cast in the frontend causing dart2js crashes during Flutter web builds.

3.0.4 SDK Dart format #
Alterado

Lançado em: 2023-06-07

This patch release fixes dart format for nullable record types with no fields and errors when using records in web development mode.

3.0.3 SDK Frontend #
Alterado

Lançado em: 2023-02-07

This patch release fixes AOT compiler crashes, pattern matching issues, adds missing interface modifiers, and improves linter support.

3.0.2 SDK Dart2js #
Alterado

Lançado em: 2023-05-24

This patch release fixes dart2js crashes with switch expressions on records, adds class modifier chips to dart doc, and fixes parser infinite loops.

3.0.1 SDK Compiler #
Alterado

Lançado em: 2023-05-17

This patch release fixes compiler crashes with redirecting factories and FFI, dart2js crashes with local functions and records, and various other bugs.

SDK Dart 3 #
Alterado

Introduced major language features including records, patterns, class modifiers, and 100% sound null safety. Also made many other improvements and breaking changes across the platform.

Language Patterns #
Novo

Added support for patterns, a new category of grammar that lets you match and destructure values.

Language Records #
Novo

Added support for records, a new type that lets you aggregate multiple values of different types in a single function return.

Language Class modifiers #
Novo

Added support for class modifiers, a new set of keywords that let you control how a class or mixin can be used.

Language Switch expressions #
Novo

Added support for switch expressions, a new form of multi-way branching allowed where expressions are expected.

Language Patterns #
Novo

Added support for if-case clauses, a new conditional construct that matches a value against a pattern and executes the then or else branch, depending on whether the pattern matches.

Language Patterns #
Versionado por linguagem Alterado

Changed interpretation of switch cases from constant expressions to patterns.

Language Class modifiers #
Versionado por linguagem Alterado Breaking

Class declarations from libraries that have been upgraded to Dart 3.0 can no longer be used as mixins by default.

Language Named parameters #
Versionado por linguagem Alterado Breaking

It is now a compile time error if a colon (:) is used as the separator before the default value of an optional named parameter. Use an equal sign (=) instead.

Language Control flow #
Alterado Breaking

It is now a compile-time error if a continue statement targets a label that is not attached to a loop statement (for, do, and while) or a switch member.

Libraries #
Alterado

The following existing classes have been made mixin classes: Iterable, IterableMixin, IterableBase, ListMixin, SetMixin, MapMixin, LinkedListEntry, StringConversionSink.

Libraries dart:async #
Removido Breaking

The following APIs have been removed:

dart:core + onError argument removed from int.parse, double.parse, and num.parse. + Deprecated.expires (use Deprecated.message instead).

  • proxy, Provisional, BidirectionalIterator classes and constants. + There errors were removed: AbstractClassInstantiationError, CyclicInitializationError, NullThrownError, FallThroughError, CastError (use TypeError), NoSuchMethodError default constructor (use NoSuchMethod.withInvocation).

dart:async + DeferredLibrary (use the import ... deferred as ... syntax instead).

dart:developer + MAX_USER_TAGS removed from UserTag.

dart:html + document.registerElement and registerElement2

Libraries dart:core #
Descontinuado

List constructor: Deprecated in favor of List.filled.

Libraries dart:async #
Removido Breaking

Removed the deprecated DeferredLibrary class.

Libraries dart:collection #
Versionado por linguagem Alterado

Changes to platform libraries.

Libraries dart:developer #
Removido Breaking

Removed the deprecated MAX_USER_TAGS constant. Use maxUserTags instead.

Libraries dart:developer #
Removido Breaking

Removed the deprecated Metrics and Metric classes as they have been broken since Dart 2.0.

Libraries dart:developer #
Removido Breaking

Removed the deprecated Counter class as it has been broken since Dart 2.0.

Libraries dart:developer #
Removido Breaking

Removed the deprecated Gauge class as it has been broken since Dart 2.0.

Libraries dart:ffi #
Experimental Descontinuado

The @FfiNative annotation is now deprecated. Usages should be updated to use the @Native annotation.

Libraries dart:html #
Removido Breaking

Removed the deprecated registerElement and registerElement2 methods in Document and HtmlDocument.

Libraries dart:math #
Versionado por linguagem Descontinuado

The Random interface can only be implemented, not extended.

Libraries dart:io #
Novo Alterado

Updated NetworkProfiling to accommodate new String ids that are introduced in vm_service:11.0.0

Language Language versioning #
Removido Breaking

The 3.0 release of the Dart SDK dropped support for language versions before 2.12.

2.19

# Lançado em 2023-01-24
2.19.6 SDK VM #
Alterado

Lançado em: 2023-03-29

This patch release fixes a Dart VM crash when reading a defined but uninitialized static field.

2.19.5 SDK FFI #
Alterado

Lançado em: 2023-03-22

This patch release fixes broken usage of Dart_CObject_Type.

2.19.4 SDK VM #
Alterado

Lançado em: 2023-03-08

This patch release fixes VM crashes on mobile devices caused by specific RegExp usage.

2.19.3 SDK Analysis server #
Alterado

Lançado em: 2023-03-01

This patch release updates DDC configuration and limits the number of plugins per analysis context to prevent extreme memory usage in the Analysis Server.

2.19.2 SDK VM #
Alterado

Lançado em: 2023-02-08

This patch release fixes VM crashes with mixed double/float calculations, compiler crashes when inlining methods with many optional parameters, and part_of_different_library errors in PackageBuildWorkspace.

2.19.1 SDK Pub #
Alterado

Lançado em: 2023-02-01

This patch release fixes pub get behavior with older lockfiles, stops rewriting SDK constraints, and fixes a VM crash caused by incorrect RegExp sharing between isolates.

SDK Unnamed libraries #
Alterado

Introduced support for unnamed libraries, improved flow analysis for unreachable code, and reported compile-time errors for cyclic dependencies during top-level type inference.

Language Unnamed libraries #
Novo

Added support for unnamed libraries. Library directives, used for appending library-level doc comments and annotations, can and should now be written without a name:

dart
/// A really great test library.
@TestOn('browser')
library;
Language Flow analysis #
Alterado

Added more flow analysis flags for unreachable code cases.

Language Flow analysis #
Alterado

Flagged additional code as unreachable due to types Null and Never.

Language Private names #
Alterado

Don't delegate inaccessible private names to noSuchMethod.

Language Type inference #
Alterado

Report a compile-time error for all cyclic dependencies during top-level type inference.

Libraries dart:convert #
Removido Breaking

The previously deprecated API DEFAULT_BUFFER_SIZE in JsonUtf8Encoder has been removed.

Libraries dart:developer #
Removido Breaking

Removed previously deprecated APIs kInvalidParams, kExtensionError, kExtensionErrorMax, and kExtensionErrorMin in ServiceExtensionResponse.

Libraries dart:ffi #
Alterado

Changed the runtime type argument of Pointer to Never in preparation of completely removing the runtime type argument. Changed Pointer.toString to not report any type argument.

Libraries dart:io #
Alterado

Disallow negative or hexadecimal content-length headers.

Libraries dart:io #
Novo Alterado

File.create now takes new optional exclusive bool parameter, and when it is true the operation will fail if target file already exists.

Libraries dart:io #
Alterado

Calling ResourceHandle.toFile(), ResourceHandle.toSocket(), ResourceHandle.toRawSocket() or ResourceHandle.toRawDatagramSocket(), more than once now throws a StateError.

Libraries dart:isolate #
Alterado

Reverted SendPort.send back to strict checks on contents of messages when sending messages between isolates that are not known to share the same code.

Libraries dart:mirrors #
Removido Breaking

Removed APIs MirrorsUsed and Comment.

Libraries package:js #
Alterado Descontinuado

Breaking changes to the preview feature @staticInterop:

  • Disallowed classes with this annotation from using external generative constructors. See 48730 and 49941 for more details.
  • Disallowed classes with this annotation's external extension members from using type parameters.
  • Classes with this annotation should also have the @JS annotation.
  • Classes with this annotation can not be implemented by classes without this annotation.
Libraries dart2js #
Descontinuado

dart2js no longer supports HTTP URIs as inputs.

2.18

# Lançado em 2022-08-30
2.18.5 SDK Variables #
Alterado

Lançado em: 2022-11-23

This patch release fixes issues with private variable setters in mixins on web and type parameter nullability in factory constructors.

2.18.4 SDK Hot reload #
Alterado

Lançado em: 2022-11-02

This patch release fixes crashes during hot reload.

2.18.3 SDK Code coverage #
Alterado

Lançado em: 2022-10-19

This patch release fixes a regression in code coverage computation.

2.18.2 SDK Uri #
Alterado

Lançado em: 2022-09-28

This patch release fixes incorrect behavior in Uri.parse and a compiler crash.

2.18.1 SDK Type inference #
Alterado

Lançado em: 2022-09-14

This patch release fixes a crash caused by incorrect type inference.

SDK Type inference #
Alterado

Enhanced type inference for generic invocations with function literals, introduced breaking changes in dart:io networking APIs, and removed standalone tools like dart2js and dartanalyzer.

Language Type inference #
Novo

Enhanced type inference. This change allows information flow between arguments in generic function calls. Before 2.18, if you didn't specify an argument's type in some methods, Dart reported errors. These type errors cited potential null occurrences. With 2.18, the compiler infers the argument type from other values in an invocation. You don't need to specify the argument type inline.

Language Mixins #
Removido Breaking

Removed support for mixin of classes that don't extend Object.

Libraries dart:io #
Alterado

Changed the uri property of RedirectException in dart:io to be nullable.

Libraries dart:io #
Removido Breaking

Removed constants in dart:io networking APIs following the SCREAMING_CAPS convention.

Libraries dart:io #
Descontinuado

The Dart VM no longer automatically restores the initial terminal settings upon exit.

Tools #
Removido Breaking

Fully discontinued the .packages file.

Tools Dart command line #
Removido Breaking

Removed the standalone dart2js and dartdevc tools.

Tools Dart command line #
Removido Breaking

Removed the standalone dartanalyzer tool.

2.17

# Lançado em 2022-05-11
2.17.7 SDK Debugger #
Alterado

Lançado em: 2022-08-24

This patch release fixes a crash in the debugger.

2.17.6 SDK Flutter #
Alterado

Lançado em: 2022-07-13

This patch release improves code completion for Flutter, fixes a crash on ARM, and fixes a compiler crash with Finalizable parameters.

2.17.5 SDK Analyzer #
Alterado

Lançado em: 2022-06-22

This patch release improves analysis of enums and switch statements, and fixes a compiler crash when initializing Finalizable objects.

2.17.3 SDK Dart VM #
Alterado

Lançado em: 2022-06-01

This patch release fixes a Dart VM compiler crash, code completion for method overrides, dart pub login, and analysis of enhanced enums.

2.17.1 SDK Analyzer #
Alterado

Lançado em: 2022-05-18

This patch release fixes an analyzer plugin crash, FFI support for late Finalizable variables, and dart compile on macOS 10.15.

SDK Enhanced enums #
Alterado

Introduced enhanced enums with members, super-initializer parameters, named arguments anywhere, and updates to dart:core and dart:ffi.

Language Enhanced enums #
Novo

Added support for enhanced enums with members. Enhanced enums allow enum declarations to define members including fields, constructors, methods, getters, etc.

Language Super parameters #
Novo

Added support for super-initializer parameters. Super parameters allow you to avoid having to manually pass each parameter into the super invocation of a non-redirecting constructor. You can instead use super parameters to forward parameters to a superclass constructor.

Language Named parameters #
Novo

Added support for named arguments anywhere. Named arguments can now be freely interleaved with positional arguments. You can write the following code:

dart
void main() {
  test(skip: true, 'A test description', () {
    // Very long function body here...
  });
}
Libraries dart:io #
Novo

Added new connectionFactory property to HttpClient.

Libraries dart:io #
Corrigido Novo

Added new keyLog property to HttpClient, which allows TLS keys to be logged for debugging purposes.

Libraries dart:io #
Removido Breaking

Removed constants in dart:io following the SCREAMING_CAPS

Libraries dart:io #
Novo

Added a new allowLegacyUnsafeRenegotiation property to SecurityContext, which allows TLS renegotiation for client secure sockets.

Tools Dart command line #
Descontinuado

Deprecated the standalone dart2js tool.

Tools Dart command line #
Descontinuado

Deprecated the standalone dartdevc tool.

Tools Dart command line #
Removido Breaking

Removed the standalone dartdoc tool.

2.16

# Lançado em 2022-02-03
2.16.2 SDK Flutter web #
Alterado

Lançado em: 2022-03-24

This patch release fixes a dart2js crash when building some Flutter web apps.

2.16.1 SDK Flutter AOT #
Alterado

Lançado em: 2022-02-09

This patch release fixes an AOT precompiler crash when building some Flutter apps.

SDK Tooling updates #
Alterado

Added Error.throwWithStackTrace, Abi specific integers in FFI, improved dart pub with concurrency and new commands, and deprecated standalone tools in favor of dart commands.

Libraries dart:io #
Novo

On Windows, Directory.rename will no longer delete a directory if newPath specifies one. Instead, a FileSystemException will be thrown.

Libraries dart:io #
Removido Breaking

Removed the Platform.packageRoot API.

Libraries dart:isolate #
Removido Breaking

Removed the Isolate.packageRoot API.

Tools Dart command line #
Descontinuado

Deprecated the standalone dartanalyzer tool.

Tools Dart command line #
Descontinuado

Deprecated the standalone dartdoc tool.

Tools Dart command line #
Removido Breaking

Removed the deprecated standalone pub tool.

2.15

# Lançado em 2021-12-08
2.15.1 SDK Flutter AOT #
Alterado

Lançado em: 2021-12-14

This patch release fixes an AOT compilation failure in some Flutter apps and issues with dart pub publish for servers with a path in the URL.

SDK Constructor tear-offs #
Alterado

Introduced constructor tear-offs, generic type literals, explicit generic method instantiations, and improvements to dart:core enums and developer tools.

Language Constructor tear-offs #
Novo

Improved support for function pointers, known as tear-offs. In particular, constructor tear-offs are now supported.

Libraries dart:io #
Alterado

Updated the SecurityContext class to set the minimum TLS protocol version to TLS1_2_VERSION (1.2) instead of TLS1_VERSION.

Libraries dart:web_sql #
Removido Breaking

Completely deleted the dart:web_sql library.

Libraries dart:html #
Removido Breaking

Removed window.openDatabase (related to dart:web_sql deletion above).

Tools Dart command line #
Removido Breaking

Removed the standalone dart2native tool.

Tools Dart command line #
Removido Breaking

Removed the standalone dartfmt tool.

Tools Dart VM #
Removido Breaking

Removed support for dart-ext:-style native extensions

Tools Dart VM #
Alterado

Grouped isolates spawned via the Isolate.spawn() API to operate on the same managed heap, and therefore share various VM-internal data structures.

2.14

# Lançado em 2021-09-09
2.14.4 SDK Analyzer #
Alterado

Lançado em: 2021-10-14

This patch release fixes a memory leak of analyzer plugins and issues with Dart VM loading expired certificates on Windows.

2.14.3 SDK Performance #
Alterado

Lançado em: 2021-09-30

This patch release fixes a code completion performance regression and debug information emitted by the Dart VM.

2.14.2 SDK Dartdoc #
Alterado

Lançado em: 2021-09-16

This patch release fixes dartdoc crashes, error messages for >>> on older language versions, and invalid pubspec.lock paths on Windows.

2.14.1 SDK Performance #
Alterado

Lançado em: 2021-09-09

This patch release fixes Dart commandline tool startup performance on macOS ARM64 (Apple Silicon).

SDK Triple shift #
Alterado

Introduced the triple-shift operator >>>, removed restrictions on type arguments for annotations, and added new features to dart:core and dart:ffi.

Language Operators #
Novo

Added support for the triple-shift operator (>>>). This new operator works like >>, except that it always fills the most significant bits with zeros.

Language Annotations #
Alterado

Removed restrictions on type arguments for annotations. You can pass type arguments to annotations and use a generic function type as a type argument. As of this release, you can write the following code:

dart
@TypeHelper<int>(42, "The meaning")
late List<T Function<T>(T)> idFunctions;
var callback = [<T>(T value) => value];
late S Function<S extends T Function<T>(T)>(S) f;
Libraries dart:io #
Alterado

The setter callbacks .authenticate and .authenticateProxy in HttpClient must now accept a nullable realm argument (for pre-migrated null safe code).

Libraries dart:typed_data #
Descontinuado

Most types exposed by this library can no longer be extended, implemented or mixed-in.

Tools Dart VM #
Novo

Expandos, and the object parameters of Dart_NewWeakPersistentHandle and Dart_NewFinalizableHandle, no longer accept Pointer and subtypes of Struct

Tools Dart command line #
Descontinuado

Deprecated the standalone dart2native tool

Tools Dart command line #
Descontinuado

Deprecated the standalone dartfmt tool.

Tools dart2js #
Descontinuado

dart2js no longer supports legacy browsers, because it emits ES6+ JavaScript by default.

Tools Dart dev compiler #
Alterado

Changed subtyping relations of package:js classes to be more correct and consistent with Dart2JS.

2.13

# Lançado em 2021-05-18
2.13.4 SDK Compiler crashes #
Alterado

Lançado em: 2021-06-28

This patch release fixes a Dart VM compiler crash and a DDC compiler crash.

2.13.3 SDK Compiler crashes #
Alterado

Lançado em: 2021-06-10

This patch release fixes a Dart compiler crash, an analysis server deadlock, and an analyzer crash when using package:meta v1.4.0.

2.13.1 SDK Type inference #
Alterado

Lançado em: 2021-05-25

This patch release fixes incorrect behavior in CastMap and missing nullability from recursive type hierarchies in DDC.

SDK Type aliases #
Alterado

Introduced non-function type aliases, improvements to dart:collection classes, and FFI support for packed structs and inline arrays.

Language Type aliases #
Novo

Added support for type aliases for any type, not just functions. Type aliases used to work only for function types but now work for any type. You can use the new name created with a type alias anywhere the original type could be used.

Libraries dart:ffi #
Novo

Added support for inline arrays in FFI structs and packed structs.

Libraries package:js #
Descontinuado

No longer valid to use a String that matches an @Native annotation in an @JS() annotation for a non-anonymous JS interop class.

2.12

# Lançado em 2021-03-03
2.12.4 SDK Compiler crashes #
Alterado

Lançado em: 2021-04-15

This patch release fixes Dart VM compiler crashes when compiling initializers containing async closures.

2.12.3 SDK Security #
Alterado

Lançado em: 2021-04-14

This patch release fixes a security vulnerability in dart:html related to DOM clobbering (CVE-2021-22540).

2.12.2 SDK Flutter crashes #
Alterado

Lançado em: 2021-03-17

This patch release fixes crashes reported by Flutter 2 users.

2.12.1 SDK HTTPS #
Alterado

Lançado em: 2021-03-10

This patch release fixes an unhandled exception in HTTPS connections and a typing issue in the typed_data + operator.

SDK Sound null safety #
Alterado

Introduced sound null safety, stable FFI, and many other new features and improvements across the platform.

Language Null safety #
Alterado

Null safety is now enabled by default in all code that has not opted out. When you opt into null safety, types in your code are non-nullable by default, meaning that variables can't contain null unless you say they can. With null safety, your runtime null-dereference errors turn into edit-time analysis errors.

Language Patch #
Corrigido

Fixed an implementation bug where this would sometimes undergo type promotion in extensions.

Libraries dart:ffi #
Novo Versionado por linguagem

The FFI library is now stable.

Libraries dart:ffi #
Descontinuado

Deprecated invocations with a generic T of sizeOf<T>, Pointer<T>.elementAt(), Pointer<T extends Struct>.ref, and Pointer<T extends Struct>[]

Libraries dart:ffi #
Descontinuado

Deprecated allocate in package:ffi, as it will no longer be able to invoke sizeOf<T> generically.

Libraries dart:ffi #
Descontinuado

Deprecated subtypes of Struct without any native member.

Tools Dart VM #
Alterado

Dart_WeakPersistentHandle no longer auto-deletes itself when the referenced object is garbage collected to avoid race conditions.

Tools Dart VM #
Removido Breaking Alterado

Renamed Dart_WeakPersistentHandleFinalizer to Dart_HandleFinalizer and removed its handle argument.

Tools Pub #
Alterado

The Dart SDK constraint is now required in pubspec.yaml.

2.10

# Lançado em 2020-09-28
2.10.5 SDK Patch #
Alterado

Lançado em: 2021-01-21

This patch release fixes a crash in the Dart VM.

2.10.4 SDK Patch #
Alterado

Lançado em: 2020-11-12

This patch release fixes a crash in the Dart VM.

2.10.3 SDK Patch #
Alterado

Lançado em: 2020-10-29

This patch release fixes breaking changes in Chrome 86 affecting DDC, compiler errors with positional parameters, and AOT compilation crashes.

2.10.2 SDK Patch #
Alterado

Lançado em: 2020-10-15

This patch release fixes a DDC compiler crash.

2.10.1 SDK Patch #
Alterado

Lançado em: 2020-10-06

This patch release fixes crashes in Flutter applications, non-deterministic behavior, and uncaught TypeErrors in DDC.

SDK Unified C API #
Alterado

Introduced a unified C API for the VM, Dart_FinalizableHandles, and deferred loading of types in dart2js.

Tools Dart VM #
Alterado

Renamed dart_api_dl.cc to dart_api_dl.c and changed to a pure C file.

2.9

# Lançado em 2020-08-05
2.9.3 SDK Patch #
Alterado

Lançado em: 2020-09-08

Fixes DDC to handle a breaking change in Chrome.

2.9.2 SDK Patch #
Alterado

Lançado em: 2020-08-26

Fixes transient StackOverflow exceptions when building Flutter applications.

2.9.1 SDK Patch #
Alterado

Lançado em: 2020-08-12

Fixes unhandled exceptions in some Flutter applications.

SDK Platform updates #
Alterado

Updates dart:io with exit returning Never and OSError implementing Exception. Improves dart:html CssClassSet methods to return false instead of null. Web compilers now error on dart:mirrors import.

Libraries dart:convert #
Alterado

When encoding a string containing unpaired surrogates as UTF-8, the unpaired surrogates will be encoded as replacement characters (U+FFFD).

Libraries dart:convert #
Alterado

When decoding UTF-8, encoded surrogates will be treated as malformed input.

Libraries dart:convert #
Alterado

Changed the number of replacement characters emitted for malformed input sequences to match the WHATWG encoding standard when decoding UTF-8 with allowMalformed: true.

Libraries dart:html #
Alterado

CssClassSet.add() and CssClassSet.toggle now return false instead of null if the CssClassSet corresponds to multiple elements.

Libraries dart:mirrors #
Alterado

Web compilers (dart2js and DDC) now produce a compile-time error if dart:mirrors is imported.

Tools Dart VM #
Alterado

When printing a string using the print function, the default implementation will print any unpaired surrogates in the string as replacement characters (U+FFFD).

Tools Dart VM #
Alterado

The Dart_StringToUTF8 function in the Dart API will convert unpaired surrogates into replacement characters.

2.8

#
2.8.4 SDK Memory leaks #
Alterado

Lançado em: 2020-06-04

Fixes potential memory leaks in the Dart front-end.

2.8.3 SDK Flutter crashes #
Alterado

Lançado em: 2020-05-28

Fixes crashes in Flutter apps, a stack trace regression, and constant re-canonicalization issues.

2.8.2 SDK AOT Compilation #
Alterado

Lançado em: 2020-05-13

Fixes an AOT compilation bug causing NoSuchMethod exceptions in global transformations.

2.8.1 SDK Null safety prep #
Alterado

Lançado em: 2020-05-06

Prepares for non-nullable types with several breaking changes to core library APIs.

2.8.1 Language Type inference #
Corrigido

Lançado em: 2020-05-06

Fixed an implementation bug where local variable inference would incorrectly use the promoted type of a type variable.

2.8.1 Language Patch #
Corrigido

Lançado em: 2020-05-06

Fixed an implementation bug surrounding the clauses implements Function, extends Function, or with Function no longer having an effect since Dart 2.0.0.

2.8.1 Libraries dart:async #
Alterado

Lançado em: 2020-05-06

Changed the return type of StreamSubscription.cancel() to Future<void>.

2.8.1 Libraries dart:async #
Descontinuado

Lançado em: 2020-05-06

Split the runZoned() function into two functions: runZoned() and runZonedGuarded(), where the latter has a required onError parameter, and the former has none.

2.8.1 Libraries dart:async #
Alterado Breaking

Lançado em: 2020-05-06

Errors passed to Completer.completeError(), Stream.addError(), Future.error(), etc. can no longer be null.

2.8.1 Libraries dart:async #
Alterado Breaking

Lançado em: 2020-05-06

Made stack traces non-null.

2.8.1 Libraries dart:core #
Alterado Breaking

Lançado em: 2020-05-06

Three members on RuneIterator no longer return null when accessed before the first call to moveNext().

2.8.1 Libraries dart:core #
Alterado Breaking

Lançado em: 2020-05-06

The String.fromEnvironment() default value for defaultValue is now an empty string instead of null.

2.8.1 Libraries dart:core #
Alterado Breaking

Lançado em: 2020-05-06

The default value for int.fromEnvironment()'s defaultValue parameter is now zero.

2.8.1 Libraries dart:ffi #
Alterado

Lançado em: 2020-05-06

Changed Pointer.asFunction() and DynamicLibrary.lookupFunction() to extension methods.

2.8.1 Libraries dart:io #
Alterado Breaking

Lançado em: 2020-05-06

Changed the signature of HttpHeaders methods add() and set.

2.8.1 Libraries dart:io #
Alterado Breaking

Lançado em: 2020-05-06

The Socket class now throws a SocketException if the socket has been explicitly destroyed or upgraded to a secure socket upon setting or getting socket options.

2.8.1 Libraries dart:io #
Alterado Breaking

Lançado em: 2020-05-06

The Process class now throws a StateError if the process is detached (ProcessStartMode.detached and ProcessStartMode.detachedWithStdio) upon accessing the exitCode getter.

2.8.1 Libraries dart:io #
Alterado Breaking

Lançado em: 2020-05-06

The Process class now also throws when not connected to the child process's stdio (ProcessStartMode.detached and ProcessStartMode.inheritStdio) upon accessing the stdin, stdout, and stderr getters.

2.8.1 Libraries dart:io #
Alterado Breaking

Lançado em: 2020-05-06

The dummy object returned if FileStat.stat() or FileStat.statSync() fail now contains Unix epoch timestamps instead of null for the accessed, changed, and modified getters.

2.8.1 Libraries dart:io #
Alterado

Lançado em: 2020-05-06

The HeaderValue class now parses more strictly in two invalid edge cases.

2.8.1 Tools Dart dev compiler #
Corrigido

Lançado em: 2020-05-06

We fixed several inconsistencies between DDC and Dart2JS so that users less frequently encounter code that is accepted by one compiler but then fails in the other.

2.8.1 Tools Dart dev compiler #
Removido Breaking

Lançado em: 2020-05-06

Deleted the legacy (analyzer based) version of DDC.

2.8.1 Tools Dart dev compiler #
Alterado Breaking

Lançado em: 2020-05-06

Functions passed to JavaScript using the recommended package:js interop specification must now be wrapped with a call to allowInterop.

2.8.1 Tools Dart dev compiler #
Alterado Breaking

Lançado em: 2020-05-06

Constructors in @JS() classes must be marked with external.

2.8.1 Tools dart2js #
Alterado

Lançado em: 2020-05-06

Corresponding type parameter bounds now only need to be mutual subtypes rather than structurally equal up to renaming of bound type variables and equating all top types.

2.8.1 Tools dart2js #
Alterado Breaking

Lançado em: 2020-05-06

Types are now normalized.

2.8.1 Tools dart2js #
Alterado Breaking

Lançado em: 2020-05-06

Constructors in @JS() classes must be marked with external.

2.8.1 Tools dart2js #
Removido Breaking

Lançado em: 2020-05-06

Completely removed the --package-root flag, which was hidden and disabled in Dart 2.0.0.

2.7

# Lançado em 2019-12-11
2.7.2 SDK Security #
Alterado

Lançado em: 2020-03-23

Fixes a security vulnerability in dart:html (CVE-2020-8923) and improves ARMv8 compatibility.

2.7.1 SDK dart2js #
Alterado

Lançado em: 2020-01-23

Improves dart2js compile-time and changes macOS SDK availability to x64 only.

SDK Extension methods #
Alterado

Introduces official support for extension methods. Adds new constructors to TypedData in dart:typed_data. Improves Dart VM field initialization on reload.

Language Extension methods #
Novo

Added support for extension methods. enabling you to add functionality to any type, even types you don't control with the brevity and auto-complete experience of regular method calls.

The following example extends the String class from dart:core with a new parseInt() method:

dart
extension ParseNumbers on String {
  int parseInt() {
    return int.parse(this);
  }
}
​
void main() {
  int i = '42'.parseInt();
  print(i);
}
Language macOS Support #
Alterado

The Dart SDK for macOS is now only available for x64.

Language Extension methods #
Alterado

Static extension members are accessible when imported with a prefix.

Libraries dart:io #
Novo

Added IOOverrides.serverSocketBind to aid in writing tests that wish to mock ServerSocket.bind.

2.6

# Lançado em 2019-11-05
2.6.1 SDK Patch #
Alterado

Lançado em: 2019-11-11

Reduces dart2js memory usage, improves ARM64 stability, and updates FFI documentation.

SDK Static extensions preview #
Alterado

Introduces a preview of static extension members. Changes inference for Null values in FutureOr contexts. Updates dart:ffi with static extension members and removes memory management.

Language Type inference #
Alterado

Changed inference when using Null values in a FutureOr context. Namely, constraints of the forms similar to Null <: FutureOr<T> now yield Null as the solution for T.

For example, the following code now prints Null. Before Dart 2.6, it printed dynamic. The anonymous closure () {} returns the Null type.

dart
import 'dart:async';
​
void foo<T>(FutureOr<T> Function() f) { print(T); }
​
main() { foo(() {}); }
Libraries dart:ffi #
Alterado

The API now makes use of static extension members.

Libraries dart:ffi #
Removido Breaking

Removed memory management Pointer.allocate and Pointer.free.

Libraries dart:ffi #
Removido Breaking

Pointer.offsetBy was removed, use cast and elementAt instead.

2.5

# Lançado em 2019-09-10
2.5.2 SDK Patch #
Alterado

Lançado em: 2019-10-08

Fixes macOS Catalina binary signing issues.

2.5.1 SDK Patch #
Alterado

Lançado em: 2019-09-27

Fixes type inference failures in the analyzer.

SDK Constant expressions #
Alterado

Expands the set of operations allowed in constant expressions, including casts, type tests, and collection features.

Libraries dart:ffi #
Novo

Added a preview of Dart FFI for calling C code.

Libraries Type system #
Alterado

Various methods and properties across various core libraries, which used to declare a return type of List<int>, were updated to declare a return type of Uint8List.

Libraries dart:io #
Alterado

The Cookie class's constructor's name and value optional positional parameters are now mandatory.

Libraries dart:io #
Alterado

The Cookie class's name and value setters now validate that the strings are made from the allowed character set and are not null.

Tools Pub #
Descontinuado

Packages published to pub.dev can no longer contain git dependencies.

2.4

# Lançado em 2019-06-27
2.4.1 SDK Patch #
Alterado

Lançado em: 2019-08-07

Fixes a performance regression in JIT mode and a potential AOT compiler crash.

SDK TransferableTypedData #
Alterado

Adds TransferableTypedData for faster cross-isolate communication. Enforces covariance of type variables used in super-interfaces. Allows async as an identifier in asynchronous and generator functions.

Language Type system #
Alterado

Covariance of type variables used in super-interfaces is now enforced.

For example: Prior to this release Dart accepted, but now rejects, the following code:

dart
class A<X> {};
class B<X> extends A<void Function(X)> {};
Language Async support #
Novo

You can now use async as an identifier in asynchronous and generator functions.

Libraries dart:isolate #
Alterado

Isolate.resolvePackageUri will always throw an UnsupportedError when compiled with dart2js or DDC.

Libraries dart:async #
Corrigido

Fixed a bug in the StreamIterator class where await for allowed null as a stream.

2.3

# Lançado em 2019-05-08
2.3.2 SDK Patch #
Alterado

Lançado em: 2019-06-11

Fixes a security vulnerability in Process.run on Linux and Android by not searching the current directory.

2.3.1 SDK Patch #
Alterado

Lançado em: 2019-05-21

Fixes a dart2js compiler crash when compiling UI-as-code features within fields.

SDK UI-as-code #
Alterado

Introduces UI-as-code features: spread operator (...), collection if, and collection for.

Language Spread operator #
Novo

Added support for the spread operator (... and ...?) in collection literals. The spread operator enables unpacking the elements from one list into another. In the following example, the list returned by buildMainElements() is unpacked into the list being passed to the children argument:

dart
Widget build(BuildContext context) {
  return Column(children: [
    Header(),
    ...buildMainElements(),
    Footer(),
  ]);
}
Language Collection if #
Novo

Added support for collection if in collection literals. The collection if operator enables adding elements conditionally. The following example adds a FlatButton element unless the app displays the last page:

dart
Widget build(BuildContext context) {
  return Column(children: [
    Text(mainText),
    if (page != pages.last)
      FlatButton(child: Text('Next')),
  ]);
}
Language Collection for #
Novo

Added support for collection for in collection literals. The collection for operator enables building repeated elements. The following example adds one HeadingAction element for each section in sections:

dart
Widget build(BuildContext context) {
  return Column(children: [
    Text(mainText),
    for (var section in sections)
      HeadingAction(section.heading),
  ]);
}

2.2

# Lançado em 2019-02-26
SDK Set literals #
Alterado

Introduces set literals using {}. Renames klass getter to classNode in Kernel AST API. Updates Link implementation on Windows to use true symbolic links.

Language Set literals #
Novo

Added support for set literals using {}.

The following example creates a set of currencies:

dart
const Set<String> currencies = {'EUR', 'USD', 'JPY'};
Libraries package:kernel #
Alterado

The klass getter on the InstanceConstant class in the Kernel AST API has been renamed to classNode for consistency.

Libraries package:kernel #
Alterado

Updated Link implementation to utilize true symbolic links instead of junctions on Windows.

2.1

# Lançado em 2018-11-15
2.1.1 SDK Patch #
Alterado

Lançado em: 2018-11-15

Fixes a soundness hole in dart:mirrors and adds a StateError when adding to a closed IOSink.

2.1.1 Libraries dart:io #
Novo Alterado

Lançado em: 2018-11-15

Added to a closed IOSink now throws a StateError.

2.1.1 Tools Dart VM #
Corrigido

Lançado em: 2018-11-15

Fixed a soundness hole when using dart:mirrors to reflectively invoke a method in an incorrect way that violates its static types.

SDK Int-to-Double Conversion #
Alterado

Introduces int-to-double conversion, new mixin syntax, and various static error checks.

Language Number types #
Novo

Added support for int-to-double conversion, allowing developers to set double values using integer literals. This feature removed the annoyance of being forced to use a double literal (for example, 4.0) when the value was an integer in concept.

In the following Flutter code, horizontal and vertical have type double:

dart
padding: const EdgeInsets.symmetric(
  horizontal: 4,
  vertical: 8,
)
Tools dart2js #
Alterado

Duplicate keys in a const map are not allowed and produce a compile-time error.

2.0

# Lançado em 2018-08-07
SDK Sound type system #
Versionado por linguagem

Introduces a sound static type system (formerly strong mode). Makes new keyword optional and const optional in const contexts. Changes async functions to run synchronously until the first await. Renames core library constants to lowerCamelCase.

Language Type system #
Alterado

Replaced the unsound optional static type system with a sound static type system using type inference and runtime checks, formerly called strong mode.

Language Async functions #
Alterado

Functions marked async now run synchronously until the first await statement.

Libraries Constants #
Alterado

Renamed constants in the core libraries from SCREAMING_CAPS to lowerCamelCase.

Libraries Type system #
Novo

Implemented a new sound type system. Before Dart 2.0, types weren't fully sound, and Dart relied heavily on runtime type checking. Dart 1.x code had to be migrated to Dart 2.

Many new methods were added to core library classes that will need to be implemented if you implement the interfaces of these classes.

Libraries Web #
Removido Breaking

dart:isolate and dart:mirrors are no longer supported when using Dart for the web.

Tools Pub #
Novo

Replaced pub's transformer-based build system with a new build system.

Filtrar por

Tipo

Área

    Versão

    Tipos de mudança

    Novo Novo
    Introduz um novo recurso ou API.
    Corrigido Corrigido
    Corrige um bug ou defeito.
    Alterado Alterado
    Modifica comportamento ou APIs existentes.
    Breaking Breaking
    Mudança incompatível que pode exigir migração de código.
    Não versionado
    O Dart SDK não mantém compatibilidade retroativa, e o código pode quebrar assim que você atualizar a versão do SDK se depender do comportamento anterior. Essa é a maioria das mudanças, e elas não recebem marcação especial.
    Versionado por linguagem Versionado por linguagem
    O Dart SDK mantém compatibilidade retroativa para código existente, e a mudança de comportamento só vale quando você atualiza a versão de linguagem do seu código.
    Descontinuações Descontinuado / Removido
    O Dart SDK mantém compatibilidade para código descontinuado, com um aviso. Depois, as descontinuações são removidas de vez em uma versão posterior, quebrando qualquer código que dependa do comportamento anterior.
    Experimental Experimental
    Faz parte da versão, mas ainda não é tratado como estável no SDK e pode quebrar de uma versão para outra.

    Encontrou essa página sem tradução ou que precisa de correção? Abra uma issue e nos ajude a manter esse site em PT-BR para ajudar pessoas como você.