language
language copied to clipboard
Design of the Dart language
Field accesses in general are not subject to promotion even for final fields, since it is in general not possible to know that the field is not overridden with a...
In the struct proposal (#2360), I propose that structs be forbidden from extending concrete structs, though I permit extension of abstract structs. There is a brief discussion of allowing more...
We introduced the `part of "librarypath.dart";` part-of syntax because it allows tools to go from a part file to the containing library file without needing to guess the context of...
I have an extension function on `List` which inserts `SizedBox` between every child to set spacing, instead of manually putting `SizedBox` between widget. What if there were 100 widgets, i...
In the extension struct proposal (#2360), I propose that extension structs should be forbidden from extending other extension structs. At the end of the proposal, there is a discussion of...
I often see people trying to check the type of a type variable by doing `if (T is int) ...`. This doesn't work, the expression `T` evaluates to a `Type`...
In the extension struct proposal (#2360), I propose extension structs as a way to support wrapper-less views on an underlying representation (see the meta-issue for linked context). In the proposal,...
Enhanced enum constructors are required to be `const`. Therefore all final non getter members are implicitly `const` as well. Additionally the index of an enum value is also pre-determined at...
Add data classes
Immutable data are used heavily for web applications today, commonly with Elm-like (redux, ngrx, ...) architectures. Most common thing web developer is doing with data is creating a copy of...
Dart treats a final nullable property as nullable even after checking that the property is not null
Considering this code: ```dart void main() { Person person = new Person( name: "Leonardo", ); if (person.jobTitle != null) { showInConsole(person.jobTitle); // Error: The argument type 'String?' can't be assigned...