Widgets

Flutter widgets are built using a modern framework that takes inspiration from React. The central idea is that you build your UI out of widgets. Widgets describe what their view should look like given their current configuration and state.

Widgets are the building blocks of a Flutter app and each widget is an immutable declaration of the UI. We create the widget tree by placing all the widgets togther.

Widgets are the configuration to create elements. Elements are the widgets made concrete, meaning mounted and painted on the screen.

We will learn how to manipulate widgets in next chapter but let's take a look to some different types of widgets :

  • Widgets with structuring elements
  • list, grid, button, text ...

  • Widgets with styling elements
  • color, border, font, weight ...

  • Widgets with input elements
  • form, formField, autocomplete ...

  • Widgets to lay out the UI
  • column, row, stack, padding ...

  • Widgets with animation
  • hero, slideTransition, fadeTransition, animatedContainer ...

  • Widgets with elements like assets
  • image, icon, assetBundle ...

  • Widgets with interactive elements
  • GestureDetector, Scrollable, Draggable ...

  • ....

Note:

We can create custom widgets.
We can use nested widgets (widget inside another widget).