Functions and classes

A Dart function accepts positional or named parameters, the latter being required or having a default value. A class groups fields and methods, and its constructor can initialize the fields directly with this.. These are the basic building blocks of Flutter widgets.

Example

class Point {
  final int x, y;
  Point({required this.x, required this.y});
}

Related concepts

The whole glossary