0%
Core Widgets

Widgets

The building blocks you'll use on every screen

15-20 min

Core Widgets

The framework contains several hundred widgets, and the official catalog is intimidating. The good news is that a real-world application constantly uses about fifteen of them, and those are worth knowing in depth rather than skimming.

The useful distinction is not "simple widget" versus "advanced widget," but content widget versus decoration widget versus structure widget. Text and Image display something. Container and Card dress up what others display. ListView organizes. Confusing the three families produces the staircase-shaped code seen in many beginner projects: seven nested Containers where two well-placed Paddings would have been enough.

This lesson presents each widget with the parameters you'll actually use, and points out what the documentation only mentions in passing: the Container that doesn't take the size you asked for, the ListView that builds a thousand items at once and tanks the frame rate, and the Image.network with no error handling that shows a gray square when the network goes down.

Comments

Comments are powered by GitHub Discussions

Sign in with GitHub to join the discussion

Link copied!