In Flutter, widgets (akin to components in React) are represented by immutable
classes that are used to configure a tree of objects. These widgets are used to
manage a separate tree of objects for layout, which is then used to manage a
separate tree of objects for compositing. Flutter is, at its core, a series of
mechanisms for efficiently walking the modified parts of trees, converting trees
of objects into lower-level trees of objects, and propagating changes across
these trees.

A widget declares its user interface by overriding the build() method, which
is a function that converts state to UI:

The build() method is by design fast to execute and should be free of side
effects, allowing it to be called by the framework whenever needed (potentially
as often as once per rendered frame).

This approach relies on certain characteristics of a language runtime (in
particular, fast object instantiation and deletion). Fortunately, Dart is
particularly well suited for this
task.

Widgets