New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dart): update dependency dart to >=2.19.6 <3.0.0 #199
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 31 31
=========================================
Hits 31 31 ☔ View full report in Codecov by Sentry. |
## [2.4.0](v2.3.1...v2.4.0) (2023-11-16) ### Features * **dart:** update dependency dart to >=2.19.6 <3.0.0 ([#199](#199)) ([0c170be](0c170be)) ### Bug Fixes * **deps:** update dependency cloud_firestore to ^4.12.2 ([#200](#200)) ([a51ab56](a51ab56)) ### Miscellaneous Chores * **deps:** lock file maintenance ([#172](#172)) ([1f6ebf1](1f6ebf1)) * **deps:** lock file maintenance ([#174](#174)) ([fdd243c](fdd243c)) * **deps:** lock file maintenance ([#180](#180)) ([a33009c](a33009c)) * **deps:** lock file maintenance ([#184](#184)) ([f77d536](f77d536)) * **deps:** lock file maintenance ([#188](#188)) ([b30c00a](b30c00a)) * **deps:** lock file maintenance ([#192](#192)) ([3ea7f43](3ea7f43)) * **deps:** lock file maintenance ([#195](#195)) ([5c9c305](5c9c305)) * **deps:** update dependency flutter_lints to v3 ([#187](#187)) ([a0a9c97](a0a9c97)) * **deps:** update dependency flutter_lints to v3.0.1 ([#194](#194)) ([524339e](524339e)) * **deps:** update dependency mocktail to v1.0.1 ([#173](#173)) ([8e45113](8e45113)) * **deps:** update dependency semantic-release to v22.0.4 ([#170](#170)) ([1d41ac6](1d41ac6)) * **deps:** update dependency semantic-release to v22.0.5 ([#171](#171)) ([977dc60](977dc60)) * **deps:** update dependency semantic-release to v22.0.6 ([#191](#191)) ([6593761](6593761)) * **deps:** update dependency semantic-release to v22.0.7 ([#193](#193)) ([b29e6a7](b29e6a7)) * **deps:** update dependency semantic-release-pub to v0.3.2 ([#176](#176)) ([d1c57c7](d1c57c7)) * **deps:** update dependency semantic-release-pub to v0.3.3 ([#182](#182)) ([158ca26](158ca26)) * **node:** update dependency node to v20 ([#185](#185)) ([b29d3d4](b29d3d4)) * **node:** update node.js to >=18.18.1 ([#179](#179)) ([9641769](9641769)) * pin node to 18.18.0 in `.nvmrc` ([#196](#196)) ([b0314a8](b0314a8)) ### Continuous Integration * **deps:** update actions/checkout digest to b4ffde6 ([#183](#183)) ([f0936d1](f0936d1)) * **deps:** update actions/setup-node action to v4 ([#186](#186)) ([ded64ca](ded64ca)) * **deps:** update subosito/flutter-action action to v2.11.0 ([#177](#177)) ([bd42950](bd42950)) * **deps:** update subosito/flutter-action action to v2.12.0 ([#189](#189)) ([0f48620](0f48620)) * **deps:** update zeshuaro/github-actions-workflows digest to 4acc72d ([#197](#197)) ([3254ec9](3254ec9)) * **deps:** update zeshuaro/github-actions-workflows digest to 68a82af ([#175](#175)) ([513bdc1](513bdc1)) * **deps:** update zeshuaro/github-actions-workflows digest to a7f44cd ([#178](#178)) ([33b5b03](33b5b03)) * **deps:** update zeshuaro/github-actions-workflows digest to cba152d ([#190](#190)) ([98d9bbc](98d9bbc)) * **renovate:** add `flutterVersion` preset ([#198](#198)) ([8609f3f](8609f3f))
🎉 This PR is included in version 2.4.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This PR contains the following updates:
>=2.12.0 <3.0.0
->>=2.19.6 <3.0.0
Release Notes
dart-lang/sdk (dart)
v2.19.6
Compare Source
This is a patch release that:
Out of Memory
exception due to a VM bug. (issue #50537).v2.19.5
Compare Source
This is a patch release that:
Dart_CObject_Type
. (issue #51459).v2.19.4
Compare Source
This is a patch release that:
#121270).
v2.19.3
Compare Source
This is a patch release that:
Updates DDC test and builder configuration. (issue #51481).
Protects the Dart Analysis Server against extreme memory usage by limiting
the number of plugins per analysis context to 1. (issue #50981).
v2.19.2
Compare Source
This is a patch release that:
Fixes a VM crash when mixing the use of double and float calculations in
debug/jit configuration. (issue #50622).
Fixes the compiler crashing when attempting to inline a method with lots of
optional parameters with distinct default values. (issue #119220).
Fixes the
part_of_different_library
error encountered when usingPackageBuildWorkspace
. (issue #51087).v2.19.1
Compare Source
This is a patch release that:
Fixes
pub get
behaviour: In Dart 2.19.0 adart pub get
with apubspec.lock
created by a 2.18 SDK will unlock all constraints, effectivelylike a
pub upgrade
(issue #51166).Stops rewriting SDK constraints: In Dart 3, a SDK constraint like
>=2.12.0 <3.0.0
gets interpreted by the pub client as>=2.12.0 <4.0.0
toallow for backwards compatibility (issue #51101).
This change was intended for Dart 3.0.0 and later, but was landed already in
2.19.0. It is now being removed in 2.19.1, as it can give confusing messages
such as:
This reinterpretation no longer happens in Dart 2.19.1.
Fixes a VM crash caused by incorrect sharing of RegExp between isolates
(issue #51130).
v2.19.0
Compare Source
Language
Breaking change #49635: Flag additional code as unreachable due to
types
Null
andNever
. Several unusual constructs that lead to unreachablecode are now recognized by flow analysis:
Control flow after an expression of the form
e ?? other
ore ??= other
,where
e
has static typeNull
andother
has static typeNever
, isconsidered unreachable.
Control flow predicated on an expression of the form
e is Never
evaluatingto
true
is considered unreachable.Control flow predicated on an expression of the form
e is! Never
evaluating to
false
is considered unreachable.Control flow on the RHS of a null-aware access such as
e?.property...
,e?.property = ...
ore?.method(...)
, wheree
has static typeNull
,is considered unreachable (Note: this can arise in the presence of extension
methods).
Previously, these behaviors only took effect if
e
was a reference to a localvariable.
Additionally, a type test of the form
v is Never
(wherev
is a localvariable) no longer promotes
v
to typeNever
.Breaking Change #49687: Don't delegate inaccessible private names to
noSuchMethod
. If a concrete class implements an interface containing amember with a name that's private to different library, and does not inherit
an implementation of that interface member, a invocation of that member will
result in an exception getting thrown. Previously, such attempts would result
in the call being diverted to the
noSuchMethod
method.This change closes a loophole in Dart's privacy system, where another library
can provide a different implementation of a supposedly private member using
noSuchMethod
, and paves the way for a future implementation of promotion forprivate final fields (see #2020).
Breaking Change #50383: Report a compile-time error for all cyclic
dependencies during top-level type inference.
Previously, some of these dependencies were ignored, based on an analysis
determining that they could not influence the inferred type. However, this
analysis was complex, differed slightly among tools, and had become much more
complex due to other changes (especially, enhanced flow analysis).
With this change, all tools treat these cyclic dependencies in the same way,
the analysis is well-understood, and, arguably, the code is more readable.
Breakage is mitigated by adding a declared type to one top-level declaration
per cycle which is now an error.
directive to be written without a name (
library;
). A library directive canbe used for library-level annotations (such as
@deprecated
) and forlibrary-level documentation comments, and with this new feature, you don't
have to provide a unique name for each library directive. Instead, a name can
simply be omitted (see #1073).
Libraries
dart:convert
[
DEFAULT_BUFFER_SIZE
][DEFAULT_BUFFER_SIZE] inJsonUtf8Encoder
has been removed.dart:core
FallThroughError
. Has not been thrown since Dart 2.0(see [#49529]).
copyWith
extension method onDateTime
(see [#24644]).RangeError.checkValidIndex
in favor ofIndexError.check
.IndexError
constructor in favor ofIndexError.withLength
constructor.
NullThrownError
andCyclicInitializationError
.Neither error is thrown by null safe code.
[#49529]: https://github.com/dart-lang/sdk/issues/49529
[#24644]: https://github.com/dart-lang/sdk/issues/24644
dart:developer
kInvalidParams
,kExtensionError
,kExtensionErrorMax
, andkExtensionErrorMin
in[
ServiceExtensionResponse
][ServiceExtensionResponse] have been removed. They have been replaced byinvalidParams
,extensionError
,extensionErrorMax
, andextensionErrorMin
.UserTag.MAX_USER_TAGS
in favor ofUserTag.maxUserTags
.dart:ffi
Pointer
haschanged to
Never
in preparation of completely removing the runtime typeargument.
Pointer.toString
has changed to not report any type argument.dart:html
slice
toSharedArrayBuffer
.registerElement
andregisterElement2
inDocument
andHtmlDocument
. These APIs were based on the deprecated Web Components v0.5specification and are not supported by browsers today. These APIs are expected
to be deleted in a future release. See the related breaking change request
#49536.
dart:io
Breaking change #49305:
Disallow negative or hexadecimal content-length headers.
Breaking change #49647:
File.create
now takes new optionalexclusive
bool
parameter, and when itis
true
the operation will fail if target file already exists.Breaking change #49878: Calling
ResourceHandle.toFile()
,ResourceHandle.toSocket()
,ResourceHandle.toRawSocket()
orResourceHandle.toRawDatagramSocket()
, more than once now throws aStateError
.The previous behavior would allow multiple Dart objects to refer to the same
file descriptor, which would produce errors when one object was closed or
garbage collected.
Adds three new
FileSystemException
subclasses to handle common error cases:PathAccessException
: The necessary access rights are not available.PathExistsException
: The path being created already exists.PathNotFoundException
: The path being accessed does not exist.dart:isolate
Isolate.run
to run a function in a new isolate.SendPort.send
is again applying strict checks to thecontents of the message when sending messages between isolates that are not
known to share the same code (e.g. an isolate spawned via
Isolate.spawnUri
).These checks were accidentally relaxed in an earlier Dart version allowing
all classes from
dart:core
anddart:collection
through. This forexample means that you can't send an instance of a
HashMap
to an isolatespawned via
Isolate.spawnUri
. See [SendPort.send
][SendPort.send] documentation forthe full list of restrictions.
dart:mirrors
MirrorsUsed
][MirrorsUsed] and [Comment
][Comment] havebeen removed.
MirrorsUsed
was experimental and deprecated;Comment
waspreviously used internally in dart2js. Both are no longer functional.
Other libraries
package:js
@staticInterop
:external
generative constructors. Use
external factory
s for these classes instead,and the behavior should be identical. This includes use of synthetic
constructors. See #48730 and #49941 for more details.
from using type parameters e.g.
external void method<T>(T t)
. Use anon-
external
extension method for type parameters instead. See #49350for more details.
@JS
annotation. You canalso have the
@anonymous
annotation with these two annotations for anobject literal constructor, but it isn't required.
annotation. This is to avoid confusing type behavior.
Tools
Analyzer
mustBeOverridden
annotation, and quick fixeslints. There are now quick fixes for over 300 diagnostic codes. These lint
rules have new fixes:
combinators_ordering
,dangling_library_doc_comments
,implicit_call_tearoffs
,library_annotations
, andunnecessary_library_directive
.body_might_complete_normally_catch_error
,cast_from_null_always_fails
,cast_from_nullable_always_fails
,deprecated_colon_for_default_value
, andduplicate_export
invalid_override_different_default_values
Linter
Updated the Linter to
1.31.0
, which includes changes thatcollection_methods_unrelated_type
.combinators_ordering
.dangling_library_doc_comments
.enable_null_safety
.implicit_call_tearoffs
.library_annotations
.unnecessary_library_directive
.unreachable_from_main
.use_string_in_part_of_directives
.no_leading_underscores_for_local_identifiers
to not report super formalsas local variables.
unnecessary_overrides
false negatives.cancel_subscriptions
for nullable fields.library_names
to support unnamed libraries.unnecessary_parenthesis
support for as-expressions.use_build_context_synchronously
to check for context property accesses.comment_references
.unnecessary_brace_in_string_interps
forthis
expressions .use_build_context_synchronously
forBuildContext.mounted
.flutter_style_todos
to handle more cases.use_build_context_synchronously
to check forBuildContext
s in namedexpressions.
exhaustive_cases
to check parenthesized expressionsavoid_redundant_argument_values
to work with enum declarations.avoid_redundant_argument_values
when referencing requiredparameters in legacy libraries.
use_super_parameters
false positives with repeated superparameter references.
use_late_for_private_fields_and_variables
to handle enums.prefer_contains
false positives when a start index is non-zero.noop_primitive_operations
to catch.toString()
in string interpolations.
public_member_api_docs
to report diagnostics on extensionnames (instead of bodies).
use_colored_box
anduse_decorated_box
to not over-report on containers withouta child.
unnecessary_parenthesis
false positives on a map-or-set literal at the start ofan expression statement.
prefer_final_locals
false positives reporting on fields.unnecessary_overrides
to allow overrides on@Protected
members.avoid_multiple_declarations_per_line
false positives infor
statements.prefer_final_locals
false positives on declaration lists with at least onenon-final variable.
use_build_context_synchronously
to handleawait
s inif
conditions.avoid_escaping_inner_quotes
.avoid_null_checks_in_equality_operators
.avoid_positional_boolean_parameters
.avoid_returning_null
.avoid_returning_null
.avoid_returning_this
.cascade_invocations
.diagnostic_describe_all_properties
.flutter_style_todos
.join_return_with_statement
.parameter_assignments
.prefer_const_constructors
.prefer_constructors_over_static_methods
.prefer_constructors_over_static_methods
.prefer_contains
.prefer_foreach
.prefer_interpolation_to_compose_strings
.prefer_interpolation_to_compose_strings
.recursive_getters
.tighten_type_of_initializing_formals
.unnecessary_lambdas
.use_late_for_private_fields_and_variables
.Pub
Treats packages with sdk constraint lower bound
>=2.12.0
or more and upperbound
<3.0.0
as compatible with<4.0.0
.Introduces content-hashes in pubspec.lock, to protect against corrupted
package repositories.
These will show up in the lock file on the first run of
dart pub get
.See https://dart.dev/go/content-hashes for more details.
New flag
dart pub get --enforce-lockfile
will fetch dependencies, but failif anything deviates from
pubspec.lock
. Useful for ensuring reproducible runsin CI and production.
Remove remaining support for
.packages
files. The flag--legacy-packages-file
is no longer supported.The client will now default to the
pub.dev
repository instead ofpub.dartlang.org
.This will cause a change in
pubspec.lock
.Support a new field
funding
inpubspec.yaml
.Validate the CRC32c checksum of downloaded archives and retry on failure.
dart pub add foo:<constraint>
with an existing dependency will now updatethe constraint rather than fail.
Update
dart pub publish
to allowdependency_overrides
inpubspec.yaml
.They will still cause a publication warning.
Note that only
dependency_overrides
from the root package effect resolution.Update
dart pub publish
to require a working resolution.If publishing a breaking release of mutually dependent packages use
dependency_overrides
to obtain a resolution.
dart pub add
will now allow adding multiple packages from any source usingthe same YAML syntax as in
pubspec.yaml
.For example:
$ dart pub add retry:^1.0.0 'dev:foo{"git":"https://github.com/foo/foo"}'
dart pub publish
will now give a warning ifdart analyze
reports any diagnostics.dart pub get
now fails gracefully when run from inside the pub-cache.dart pub publish
now shows the file sizes of large files in your package toprevent accidental publication of large unrelated files.
Fix a bug in
dart pub upgrade --major-versions
where packages not requiringmajor updates would be held back unless needed.
dart2js
dart2js no longer supports HTTP URIs as inputs.
v2.18.7
Compare Source
v2.18.6
Compare Source
v2.18.5
Compare Source
(issue #50119).
(issue #50392).
v2.18.4
Compare Source
This is a patch release that fixes crashes during hot reload
(issue flutter/flutter#113540).
v2.18.3
Compare Source
This is a patch release that fixes a regression in code coverage computation
(issue #49887).
v2.18.2
Compare Source
This is a patch release that:
Uri.parse
.Libraries
dart:core
Security advisory CVE-2022-3095:
There is a auth bypass vulnerability in Dart SDK, specifically
dart:uri
corelibrary, used to parse and validate URLs. This library is vulnerable to the
backslash-trick wherein backslash is not recognized as equivalent to forward
slash in URLs.
The
Uri
class has been changed to parse a backslash in the path or theauthority separator of a URI as a forward slash. This affects the
Uri
constructor's
path
parameter, and theUri.parse
method.This change was made to not diverge as much from the browser
URL
behavior.The Dart
Uri
class is still not an implementation of the same standardas the browser's
URL
implementation.v2.18.1
Compare Source
This is a patch release that fixes a crash caused by incorrect type inference
(issues flutter/flutter#110715 and flutter/flutter#111088).
v2.18.0
Compare Source
Language
The following features are new in the Dart 2.18 language version. To use
them, you must set the lower bound on the SDK constraint for your package to
2.18 or greater (
sdk: '>=2.18.0 <3.0.0'
).Enhanced type inference for generic invocations with function literals:
Invocations of generic methods/constructors that supply function literal
arguments now have improved type inference. This primarily affects the
Iterable.fold
method. For example, in previous versions of Dart, thecompiler would fail to infer an appropriate type for the parameter
a
:With this improvement,
a
receives its type from the initial value,0
.On rare occasions, the wrong type will be inferred, leading to a compile-time
error, for example in this code, type inference will infer that
a
has atype of
Null
:This can be worked around by supplying the appropriate type as an explicit
type argument to
fold
:Mixin of classes that don't extend
Object
is no longer supported:Mixin
:time but is now completely removed.
Core libraries
dart:async
Stream.fromIterable
stream can now be listened to more than once.dart:collection
BidirectionalIterator
.dart:core
unencodedPath
positional argument toUri.http
andUri.https
to default to an empty path.dart:html
connectionState
attribute andconnectionstatechange
listener toRtcPeerConnection
.dart:io
Breaking Change #49045:
The
uri
property ofRedirectException
indart:io
has been changed tobe nullable. Programs must be updated to handle the
null
case.Breaking Change #34218:
Constants in
dart:io
's networking APIs following theSCREAMING_CAPS
convention have been removed (they were previously deprecated). Please use
the corresponding
lowerCamelCase
constants instead.Breaking Change #45630: The Dart VM no longer automatically restores
the initial terminal settings upon exit. Programs that change the
Stdin
settings
lineMode
andechoMode
are now responsible for restoring thesettings upon program exit. E.g. a program disabling
echoMode
will nowneed to restore the setting itself and handle exiting by the appropriate
signals if desired:
This change is needed to fix #36453 where the dart programs not caring
about the terminal settings can inadvertently corrupt the terminal settings
when e.g. piping into less.
Furthermore the
echoMode
setting now only controls theecho
local modeand no longer sets the
echonl
local mode on POSIX systems (which controlswhether newline are echoed even if the regular echo mode is disabled). The
echonl
local mode is usually turned off in common shell environments.Programs that wish to control the
echonl
local mode can use the newechoNewlineMode
setting.The Windows console code pages (if not UTF-8) and ANSI escape code support
(if disabled) remain restored when the VM exits.
dart:js_util
dartify
and a number of minor helper functions.Dart VM
Implementation of
async
/async*
/sync*
is revamped in Dart VM,both in JIT and AOT modes. This also affects Flutter except Flutter Web.
Besides smaller code size and better performance of async methods,
the new implementation carries a few subtle changes in behavior:
If
async
method returns before reaching the firstawait
, it nowreturns a completed Future.
Previously
async
methods completed resulting Future in separate microtasks.Stack traces no longer have duplicate entries for
async
methods.New implementation now correctly throws an error if
null
occurs asan argument of a logical expression (
&&
and||
) which also containsan
await
.New implementation avoids unnecessary extending the liveness of local
variables in
async
/async*
/sync*
methods, which means that unusedobjects stored in local variables in such methods might be garbage
collected earlier than they were before
(see issue #36983
for details).
Tools
General
Breaking Change #48272:
The
.packages
file has been fully discontinued. Historically when thecommands
dart pub get
orflutter pub get
are executed, pub resolved alldependencies, and installs those dependencies to the local pub cache. It
furthermore created a mapping from each used package to their location on the
local file system, and wrote that into two files:
.dart_tool/package_config.json
.packages
(deprecated in Dart 2.8.0)As of Dart 2.18.0, the
.packages
is now fully desupported, and all toolsdistributed in, and based on, the Dart SDK no longer support it, and thus
solely use the
.dart_tool/package_config.json
file. If you've rundart pub get
orflutter pub get
with any Dart SDK from the past few years youalready have a
.dart_tool/package_config.json
and thus should not beimpacted. You can delete any old
.packages
files.If you have any third-party tools that for historical reasons depend on a
.packages
we will support the ability to generate a.packages
by passingthe flag
--legacy-packages-file
todart pub get
. This support will beremoved in a following stable release.
Dart command line
Breaking change #46100:
The standalone
dart2js
anddartdevc
tools have been removed as previouslyannounced.
dart2js
is replaced by thedart compile js
command,dartdevc
is no longer exposed as a command-line tool.
Breaking change #46100:
The standalone
dartanalyzer
tool has been removed as previouslyannounced.
dartanalyzer
is replaced by thedart analyze
command.Analyzer
abstract_field_constructor_initializer
,abstract_class_member
,always_put_control_body_on_new_line
,avoid_print
,avoid_renaming_method_parameters
,discarded_futures
,enum_with_abstract_member
,non_bool_condition
,super_formal_parameter_without_associated_named
,unawaited_futures
,unnecessary_final
unused_element_parameter
,deprecated_export_use
Linter
Updated the Linter to
1.25.0
, which includes changes thatdiscarded_futures
.unnecessary_null_aware_operator_on_extension_on_nullable
.unnecessary_to_list_in_spreads
.no_duplicate_case_values
lines_longer_than_80_chars
,prefer_const_constructors_in_immutables
, andprefer_initializing_formals
.prefer_final_parameters
to support super parameters.unawaited_futures
to handle string interpolatedfutures.
use_colored_box
to not flag nullable colors,no_leading_underscores_for_local_identifiers
to lint local function declarations.
avoid_init_to_null
to correctly handle superinitializing defaults that are non-null.
no_leading_underscores_for_local_identifiers
to allow identifiers with just underscores.
flutter_style_todos
to support usernames thatstart with a digit.
require_trailing_commas
to handle functionsin asserts and multi-line strings.
unsafe_html
to allow assignments toimg.src
.unnecessary_null_checks
to properly handle mapliteral entries.
Pub
dart pub get
anddart pub upgrade
no longer create the.packages
file. For details, see breaking change #48272 above.dart pub outdated
now shows which of your dependencies are discontinued.dart pub publish
will now list all the files it is about to publish.v2.17.7
Compare Source
This is a patch release that:
v2.17.6
Compare Source
This is a patch release that:
v2.17.5
Compare Source
This is a patch release that:
(issue #49075).
v2.17.3
Compare Source
This is a patch release that fixes:
dart pub login
command (issue #3424).v2.17.1
Compare Source
This is a patch release that fixes:
late
Finalizable
variables (issue #49024).dart compile
on macOS 10.15 (issue #49010).v2.17.0
Compare Source
Language
The following features are new in the Dart 2.17 language version. To use
them, you must set the lower bound on the SDK constraint for your package to
2.17 or greater (
sdk: '>=2.17.0 <3.0.0'
).Enhanced enums with members: Enum declarations can now define
members including fields, constructors, methods, getters, etc. For example:
Constructors must be
const
since enum values are always constants. If theconstructor takes arguments, they are passed when the enum value is
declared.
The above enum can be used like so:
Super parameters: When extending a class whose constructor takes
parameters, the subclass constructor needs to provide arguments for them.
Often, these are passed as parameters to the subclass constructor, which
then forwards them to the superclass constructor. This is verbose because
the subclass constructor must list the name and type of each parameter in
its parameter list, and then explicitly forward each one as an argument to
the superclass constructor.
@roy-sianez suggested allowing
super.
before a subclassconstructor parameter to implicitly forward it to the corresponding
superclass constructor parameter. Applying this feature to Flutter
eliminated nearly 2,000 lines of code. For example, before:
And using super parameters:
From our analysis, over 90% of explicit superclass constructor calls can be
completely eliminated, using
super.
parameters instead.Named args everywhere: In a function call, Dart requires positional
arguments to appear before named arguments. This can be frustrating for
arguments like collection literals and function expressions that look best
as the last argument in the argument list but are positional, like the
test()
function in the test package:It would be better if the
skip
argument appeared at the top of the callto
test()
so that it wasn't easily overlooked, but since it's named andthe test body argument is positional,
skip
must be placed at the end.Dart 2.17 removes this restriction. Named arguments can be freely
interleaved with positional arguments, allowing code like:
Core libraries
dart:core
Finalizer
andWeakReference
which can potentially detect whenobjects are "garbage collected".
isMimeType
method toUriData
class, to allow case-insensitivechecking of the MIME type.
isCharset
andisEncoding
methods toUriData
class,to allow case-insensitive and alternative-encoding-name aware checking
of the MIME type "charset" parameter.
UriData.fromString
andUriData.fromBytes
recognize and omita "text/plain"
mimeType
even if it is not all lower-case.dart:ffi
ref=
and[]=
methods to theStructPointer
andUnionPointer
extensions. They copy a compound instance into a native memory region.
AbiSpecificInteger
s for common C types:char
unsigned char
signed char
short
unsigned short
int
unsigned int
long
unsigned long
long long
unsigned long long
uintptr_t
size_t
wchar_t
NativeFinalizer
which can potentially detect when objects are"garbage collected".
NativeFinalizer
s run native code wheredart:core
'sFinalizer
s run Dart code on finalization.dart:html
scrollIntoViewIfNeeded
toElement
. Previously, this method was nestedwithin
scrollIntoView
based on theScrollAlignment
value.scrollIntoView
is unchanged for now, but users who intend to use the native
Element.scrollIntoViewIfNeeded
should use the newscrollIntoViewIfNeeded
definition instead.
Performance.mark
andPerformance.measure
to accept their differentoverloads.
mark
can now accept amarkOptions
map, andmeasure
can nowaccept a
startMark
andendMark
, or ameasureOptions
map. Both methodsreturn their correct return types now as well -
PerformanceEntry?
andPerformanceMeasure?
, respectively.dart:indexed_db
IdbFactory.supportsDatabaseNames
has been deprecated. It will always returnfalse
.dart:io
Breaking Change #47887:
HttpClient
has a newconnectionFactory
property, which allows socketcreation to be customized. Classes that
implement HttpClient
may be brokenby this change. Add the following method to your classes to fix them:
Breaking Change #48093:
HttpClient
has a newkeyLog
property, which allows TLS keys to be loggedfor debugging purposes. Classes that
implement HttpClient
may be broken bythis change. Add the following method to your classes to fix them:
Breaking Change #34218:
Constants in
dart:io
following theSCREAMING_CAPS
convention have beenremoved (they were previously deprecated). Please use the corresponding
lowerCamelCase
constants instead.Breaking Change #48513:
Add a new
allowLegacyUnsafeRenegotiation
property toSecurityContext
,which allows TLS renegotiation for client secure sockets.
Add a optional
keyLog
parameter toSecureSocket.connect
andSecureSocket.startConnect
.Deprecate
SecureSocket.renegotiate
andRawSecureSocket.renegotiate
,which were no-ops.
Tools
Dart command line
Breaking change #46100:
The standalone
dart2js
tool has beenmarked deprecated as previously announced.
Its replacement is the
dart compile js
command.Should you find any issues, or missing features, in the replacement
command, kindly file an issue.
Breaking change #46100:
The standalone
dartdevc
tool has been marked deprecated as previouslyannounced and will be deleted in a future Dart stable release. This tool
was intended for use only by build systems like bazel,
build_web_compilers
and
flutter_tools
. The functionality remains available for those systems,but it is no longer exposed as a command-line tool in the SDK.
Please share any concerns in the
breaking change tracking issue.
Breaking change #46100:
The standalone
dartdoc
tool has been removed aspreviously announced. Its replacement is the
dart doc
command.The template names used in the
dart create
command have been simplified,and the current template names are now the set shown below. (Note: for
backwards compatibility the former template names can still be used.)
Analyzer
always_use_package_imports
,avoid_void_async
,cascade_invocations
,default_list_constructor
,must_call_super
,no_leading_underscores_for_local_identifiers
,null_check_on_nullable_type_parameter
,prefer_function_declarations_over_variables
,sort_constructors_first
,sort_unnamed_constructors_first
,undefined_enum_constant
,unnecessary_late
,unnecessary_null_aware_assignments
,use_enums
,use_raw_strings
,use_super_parameters
,var_return_type
unnecessary_final
compound_implements_finalizable
Linter
Updated the Linter to
1.22.0
, which includes changes thatinvariant_booleans
.depend_on_referenced_packages
to treatflutter_gen
as a virtualpackage, not needing an explicit dependency.
unnecessary_null_checks
andnull_check_on_nullable_type_parameter
to handlelist/set/map literals, and
yield
andawait
expressions.unnecessary_null_aware_assignments
property-accessfalse positives.
use_super_parameters
.use_enums
.use_colored_box
.sort_constructors
.always_use_package_imports
,avoid_print
, andavoid_relative_lib_imports
.avoid_void_async
to skipmain
functions.prefer_final_parameters
to not super on super params.features.
unnecessary_late
to report on variable names.null_check_on_nullable_type_parameter
stable.Dartdoc
Updated dartdoc to 5.1.0, which includes changes that
[...]
linkscategoryOrder
optionv2.16.2
Compare Source
This is a patch release that fixes a dart2js crash when building some Flutter
web apps (issue #47916).
v2.16.1
Compare Source
This is a patch release that fixes an AOT precompiler crash when building some
Flutter apps (issue flutter/flutter#97301).
v2.16.0
Compare Source
Core libraries
dart:core
Error.throwWithStackTrace
which canthrow
anerror with an existing stack trace, instead of creating
a new stack trace.
dart:ffi
Abi
andAbiSpecificInteger
. These enable specifying integers whichhave different sizes/signs per ABI (hardware and OS combination).
dart:io
CVE-2022-0451,
breaking change #45410:
HttpClient
no longer transmits some headers (i.e.authorization
,www-authenticate
,cookie
,cookie2
) when processing redirects to adifferent domain.
On Windows,
Directory.rename
will no longer delete a directory ifnewPath
specifies one. Instead, aFileSystemException
will be thrown.The
Platform.packageRoot
API has been removed. It had been marked deprecatedin 2018, as it doesn't work with any Dart 2.x release.
sourcePort
parameter toSocket.connect
,Socket.startConnect
,RawSocket.connect
andRawSocket.startConnect
dart:isolate
The
Isolate.packageRoot
API has been removed. It had been marked deprecatedin 2018, as it doesn't work with any Dart 2.x release.
Tools
Dart command line
The standalone
dartanalyzer
tool has beenmarked deprecated as previously announced.
Its replacement is the
dart analyze
command.Should you find any issues, or missing features, in the replacement
command, kindly file an issue.
The standalone
dartdoc
tool has beenmarked deprecated as previously announced.
Its replacement is the
dart doc
command.Should you find any issues, or missing features, in the replacement
command, kindly file an issue.
The deprecated standalone
pub
tool has been removed.Its replacement is the
dart pub
command.Should you find any issues, or missing features, in the replacement
command, kindly file an issue.
Pub
Fixed race conditions in
dart pub get
,dart run
anddart pub global run
.It should now be safe to run these concurrently.
If (when) Pub crashes it will save a verbose log in
$PUB_CACHE/log/pub_log.txt
This can be used for filing issues to the issuetracker.
dart --verbose pub [command]
will also cause the log file to be written.dart pub global activate --source=git
now takes arguments--git-path
tospecify the path of the activated package in the pubspec and
--git-ref
tospecify the branch or revision to check out.
dart pub add
can now add multiple packages in one command.dart pub token add
can now add a token for pub.dev.dart pub uploader
has been removed. To manage uploaders for a package usethe
https://pub.dev/<packagename>/admin
web-interface.Pub now supports a separate
pubspec_overrides.yaml
file that can containdependency_overrides
. This makes it easier to avoid checking the localoverrides into version control.
Linter
Updated the Linter to
1.18.0
, which includes changes thatcamel_case_types
to cover enums.no_leading_underscores_for_local_identifiers
to notmis-flag field formal parameters with default values.
prefer_function_declarations_over_variables
to notmis-flag non-final fields.
prefer_contains
.exhaustive_cases
to skip deprecated values thatredirect to other values.
unnecessary_late
.prefer_initializing_formals
.secure_pubspec_urls
to checkissue_tracker
andrepository
entries.conditional_uri_does_not_exist
.missing_whitespace_between_adjacent_strings
.avoid_final_parameters
.no_leading_underscores_for_library_prefixes
.no_leading_underscores_for_local_identifiers
.secure_pubspec_urls
.sized_box_shrink_expand
.use_decorated_box
.omit_local_variable_types
.v2.15.1
Compare Source
This is a patch release that fixes:
dart pub publish
for servers with a path in the URL (prdart-lang/pub#3244).
v2.15.0
Compare Source
Security advisory
CVE-2021-22567:
Bidirectional Unicode text can be interpreted and compiled differently than
how it appears in editors and code-review tools. Exploiting this an attacker
could embed source that is invisible to a code reviewer but that modifies the
behavior of a program in unexpected ways. Dart 2.15.0 introduces new analysis
warnings that flags the use of these.
Security advisory
CVE-2021-22568:
A malicious third-party package repository may impersonate a user on pub.dev
for up to one hour after the user has published a package to that third-party
package repository using
dart pub publish
. As of Dart SDK version 2.15.0requests to third-party package repositories will no longer include an OAuth2
access_token
intended for pub.dev.Language
The following features are new in the Dart 2.15 language version. To use
them, you must set the lower bound on the SDK constraint for your package to
2.15 or greater (
sdk: '>=2.15.0 <3.0.0'
).instance to be passed as a closure, and similarly for static methods. This is
commonly referred to as "closurizing" or "tearing off" a method. Constructors
were not previously eligible for closurization, forcing users to explicitly
write wrapper functions when using constructo
Configuration
📅 Schedule: Branch creation - "after 6pm every weekday,every weekend" in timezone Australia/Sydney, Automerge - "after 6pm every weekday,every weekend" in timezone Australia/Sydney.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.