Dart と仲良くなる

If you’re sure that a variable is set before it’s used, but Dart disagrees, you can fix the error by marking the variable as late:
なるほど。

void main() {
late int lineCount = f();
print("=== Before eval ===");
print(lineCount);
print("=== After eval ===");
}
int f() {
print('f() is evaluated !!!');
return 777;
}
output
=== Before eval ===
f() is evaluated !!!
777
=== After eval ===

A final variable can be set only once; a const variable is a compile-time constant.
認識相違なし
Note: Instance variables can be final but not const.
ふむふむ

collection if か

// Assign value to a
a = value;
// Assign value to b if b is null; otherwise, b stays the same
b ??= value;

String playerName(String? name) => name ?? 'Guest';

?[]

However, Dart programs can throw any non-null object—not just Exception and Error objects—as an exception.
どゆこと..?

late final とは?

this を使うのは命名に被りがある場合のみ

コンストラクタを定義しなくても引数なしのデフォルトコンストラクタが利用できる

superclass のコンストラクタがようわからん

Initializer list あんまりわかってない
validation に使うっぽい
Point.withAssert(this.x, this.y) : assert(x >= 0) {
print('In Point.withAssert(): ($x, $y)');
}

Redirecting constructors なるほど

For example, a factory constructor might return an instance from a cache, or it might return an instance of a subtype. Another use case for factory constructors is initializing a final variable using logic that can’t be handled in the initializer list.
へー

factory ピンと来てない

A common use case is ensuring that a type is non-nullable by making it a subtype of Object (instead of the default, Object?).
class Foo<T extends Object> {
// Any type provided to Foo for T must be non-nullable.
}

Lazily loading a library なるほど

await for

decimal/decimal