commit | f1843b0abed6b43eb2e737b0edd52671c9c31eda | [log] [tgz] |
---|---|---|
author | Paul Berry <paulberry@google.com> | Tue Oct 20 17:45:04 2020 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Tue Oct 20 17:45:04 2020 +0000 |
tree | c23259cfe84dfba7cbd3cc95623eedf9e55d87de | |
parent | 265ecc7488d14699febdafc01445227c0d1098c7 [diff] |
Add special case migration logic for iterator methods. This logic allows us to migrate code like this: int firstEven(Iterable<int> values) => values.firstWhere((i) => i.isEven, orElse: () => null); Into: import 'package:collection/collection.dart' show IterableExtension; int? firstEven(Iterable<int> values) => values.firstWhereOrNull((i) => i.isEven); Rather than the default behavior, which would migrate it to: int? firsteven(Iterable<int?> values) => values.firstWhere((i) => i!.isEven, orElse: () => null); (The new migration is far superior because it doesn't require the input iterable to accept null). This functionality is disabled at the moment, because: - The changes it makes don't show up properly in the web preview. - The pubspec is not yet properly updated. I will address these issues in follow-up CLs and then enable the feature. Change-Id: I96f3b12d682c586631920b38406bad6aa3f4789e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168500 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, getting started, and more.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.