Widget Basics
What’s a widget?
Flutter provides a vast number of building blocks or blueprints you can use to build your UI. Those parts we refer to as widgets.
Widgets include information about how they are to appear in the UI. Examples of some commonly used widgets are: rows, columns, padding, and text.
Technically, even your whole app classes as a widget.
Widgets are arranged in a parent-child tree structure. And while there are wast amounts of prebuild widgets in existence already you can easily write your own from scratch or extend existing ones.
It really appears that most things in Flutter are classes as widgets, however, an important note is that a widget never does any computation but instead delegates it to other objects. Meaning that for example, a widget describing a box will delegate the rendering of said box to a render object.
There is nothing physically stopping you to not use Widgets and write your app using direct render objects etc., but sticking to widgets has the advantage that it makes your code more accessible, modular, and maintainable.
For a more in-depth introduction to widgets check out the Flutter guide.
