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