-----
During a dynamic type check, void
is not required to be null
anymore. In practice, this makes overriding void
functions with non-void
functions safer.
During static analysis, a function or setter declared using =>
with return type void
now allows the returned expression to have any type. For example, assuming the declaration int x;
, it is now type correct to have void f() => ++x;
.
A new function-type syntax has been added to the language. Intuitively, the type of a function can be constructed by textually replacing the function's name with Function
in its declaration. For instance, the type of void foo() {}
would be void Function()
. The new syntax may be used wherever a type can be written. It is thus now possible to declare fields containing functions without needing to write typedefs: void Function() x;
. The new function type has one restriction: it may not contain the old-style function-type syntax for its parameters. The following is thus illegal: void Function(int f())
. typedefs
have been updated to support this new syntax.
Examples:
typedef F = void Function(); // F is the name for a `void` callback. int Function(int) f; // A field `f` that contains an int->int function. class A<T> { // The parameter `callback` is a function that takes a `T` and returns // `void`. void forEach(void Function(T) callback); } // The new function type supports generic arguments. typedef Invoker = T Function<T>(T Function() callback);
dart:async
, dart:core
, dart:io
IOSink
, is no longer not allowed. In 1.24, violations are only reported (on stdout or stderr), but a future version of the Dart SDK will change this to throwing a StateError
.dart:convert
ChunkedConverter
class.Map<String, dynamic>
instead of Map<dynamic, dynamic>
. A JSON-map is not a HashMap
or LinkedHashMap
anymore (but just a Map
).dart:io
Platform.localeName
, needed for accessing the locale on platforms that don't store it in an environment variable.ProcessInfo.currentRss
and ProcessInfo.maxRss
for inspecting the Dart VM process current and peak resident set size.RawSynchronousSocket
, a basic synchronous socket implementation.dart:
web APIs have been updated to align with Chrome v50. This change includes a large number of changes, many of which are breaking. In some cases, new class names may conflict with names that exist in existing code.
dart:html
REMOVED classes: Bluetooth
, BluetoothDevice
, BluetoothGattCharacteristic
, BluetoothGattRemoteServer
, BluetoothGattService
, BluetoothUuid
, CrossOriginConnectEvent
,DefaultSessionStartEvent
, DomSettableTokenList
, MediaKeyError
, PeriodicSyncEvent
, PluginPlaceholderElement
, ReadableStream
, StashedMessagePort
, SyncRegistration
REMOVED members:
texImage2DCanvas
was removed from RenderingContext
.endClip
and startClip
were removed from Animation
.after
and before
were removed from CharacterData
, ChildNode
and Element
.keyLocation
was removed from KeyboardEvent
. Use location
instead.generateKeyRequest
, keyAddedEvent
, keyErrorEvent
, keyMessageEvent
, mediaGroup
, needKeyEvent
, onKeyAdded
, onKeyError
, onKeyMessage
, and onNeedKey
were removed from MediaElement
.getStorageUpdates
was removed from Navigator
status
was removed from PermissionStatus
getAvailability
was removed from PreElement
Other behavior changes:
url("http://google.com")
instead of url(http://google.com)
.int
to num
.num
instead of whole numbers).setRangeText
with a selectionMode
value of 'invalid' is no longer valid. Only "select", "start", "end", "preserve" are allowed.dart:svg
dart:svg
carefully.dart:web_audio
AudioContext
– createIirFilter
returns a new class IirFilterNode
.dart:web_gl
new classes: CompressedTextureAstc
, ExtColorBufferFloat
, ExtDisjointTimerQuery
, and TimerQueryExt
.
ExtFragDepth
added: readPixels2
and texImage2D2
.
Removed ad hoc Future.then
inference in favor of using FutureOr
. Prior to adding FutureOr
to the language, the analyzer implented an ad hoc type inference for Future.then
(and overrides) treating it as if the onValue callback was typed to return FutureOr
for the purposes of inference. This ad hoc inference has been removed now that FutureOr
has been added.
Packages that implement Future
must either type the onValue
parameter to .then
as returning FutureOr<T>
, or else must leave the type of the parameter entirely to allow inference to fill in the type.
During static analysis, a function or setter declared using =>
with return type void
now allows the returned expression to have any type.
Dartium
Dartium is now based on Chrome v50. See Core library changes above for details on the changed APIs.
Pub
pub build
and pub serve
Added support for the Dart Development Compiler.
Unlike dart2js, this new compiler is modular, which allows pub to do incremental re-builds for pub serve
, and potentially pub build
in the future.
In practice what that means is you can edit your Dart files, refresh in Chrome (or other supported browsers), and see your edits almost immediately. This is because pub is only recompiling your package, not all packages that you depend on.
There is one caveat with the new compiler, which is that your package and your dependencies must all be strong mode clean. If you are getting an error compiling one of your dependencies, you will need to file bugs or send pull requests to get them strong mode clean.
There are two ways of opting into the new compiler:
Use the new --web-compiler
flag, which supports dartdevc
, dart2js
or none
as options. This is the easiest way to try things out without changing the default.
Add config to your pubspec. There is a new web
key which supports a single key called compiler
. This is a map from mode names to compiler to use. For example, to default to dartdevc in debug mode you can add the following to your pubspec:
web: compiler: debug: dartdevc
You can also use the new compiler to run your tests in Chrome much more quickly than you can with dart2js. In order to do that, run pub serve test --web-compiler=dartdevc
, and then run pub run test -p chrome --pub-serve=8080
.
The --no-dart2js
flag has been deprecated in favor of --web-compiler=none
.
pub build
will use a failing exit code if there are errors in any transformer.
pub publish
Added support for the UNLICENSE file.
Packages that depend on the Flutter SDK may be published.
pub get
and pub upgrade
dartfmt
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
I don't think it's this (since this isn't new to 1.24) but the analyser does have issues if you put things inside a folder named "packages". I've had to put some hacks in Dart Code to avoid this causing issues for the Flutter repo:
https://github.com/dart-lang/sdk/issues/29414
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Vadim, it sounds like your issue was resolved by using multiple content roots. Had the previous project structure worked for you (one content root with multiple projects?)