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
Π§ΡΠΎΠ±Ρ ΠΏΠ΅ΡΠ΅Ρ
Π²Π°ΡΠΈΡΡ ΠΎΠ±ΡΠ°ΡΠ΅Π½ΠΈΠ΅ ΠΊ Π½Π΅ΡΡΡΠ΅ΡΡΠ²ΡΡΡΠ΅ΠΌΡ ΠΌΠ΅ΡΠΎΠ΄Ρ, ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»ΠΈΡΡ noSuchMethod().
Extension methods
Enums
Adding features to a class: mixins
mixins β ΡΠΏΠ΅ΡΠΈΠ°Π»ΡΠ½ΡΠ΅ ΠΊΠ»Π°ΡΡΡ, ΡΠ°ΡΡΠΈΡΡΡΡΠΈΠ΅ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠΈ Π΄ΡΡΠ³ΠΎΠ³ΠΎ ΠΊΠ»Π°ΡΡΠ°. ΠΠΎΠ΄ΠΊΠ»ΡΡΠ°ΡΡΡΡ ΡΠ΅ΡΠ΅Π· with.
ΠΠΎΠΆΠ½ΠΎ Π·Π°Π΄Π°ΡΡ, Π΄Π»Ρ ΠΊΠ°ΠΊΠΎΠ³ΠΎ ΠΊΠ»Π°ΡΡΠ° Π΄ΠΎΡΡΡΠΏΠ½ΠΎ ΡΡΠ° ΡΠΈΡΠ°
Callable classes
Π§Π΅ΡΠ΅Π· ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΌΠ΅ΡΠΎΠ΄Π° call().
Last updated