Classes
Get type
print('The type of a is ${a.runtimeType}');Constructors
class Point {
double x = 0;
double y = 0;
Point(double x, double y) {
// There's a better way to do this, stay tuned.
this.x = x;
this.y = y;
}
}
// or
class Point {
double x = 0;
double y = 0;
// Syntactic sugar for setting x and y
// before the constructor body runs.
Point(this.x, this.y);
}Named constructor
Initializer list
Redirecting constructor
Constant constructors
Factory constructors
Methods
Abstract classes
Implicit interfaces
Extending a class
Overriding methods
Extension methods
Enums
Adding features to a class: mixins
Callable classes
Last updated