Choose a widget from the behavior you need. Each linked guide explains its role, demonstrates usage and identifies layout or lifecycle mistakes to check.
Flutter / Widget reference
Flutter widget reference: display, layout and input
Browse Flutter widgets by purpose: text, actions, images, layout, scrolling, forms and Material application structure.
Flutter widgets
Understand composition, lifecycle and the widgets used to display content and handle actions.
- Compose small widgets
Build a reusable stateless profile card with explicit inputs and a clear responsibility.
- State and lifecycle
Understand StatefulWidget, initState and dispose, and pair resource creation with cleanup.
- Text and typography
Style text through the theme, handle constrained labels and preserve readability when text size increases.
- Buttons and actions
Choose FilledButton, OutlinedButton and IconButton by action importance, and disable actions while they are unavailable.
- Images and icons
Reserve image space, provide a useful failure state and configure local assets without layout shifts.
- Containers and spacing
Separate decoration, constraints and spacing instead of reaching for a Container around every widget.
- BuildContext and keys
Distinguish a widget location from its identity, and use stable keys when stateful rows can move.
Layout and scrolling
Use constraints, flexible space, stacks, lists and grids to build predictable screens.
- Rows, columns and constraints
Understand how parent constraints, child sizes and Expanded work together in a Flutter layout.
- Responsive screens
Use LayoutBuilder to choose a practical layout without assuming every device has the same screen width.
- Stack and Positioned
Layer content deliberately, choose a bounded parent and avoid using absolute positioning for an entire responsive screen.
- ListView and lazy item building
Build visible list items on demand, keep state out of temporary row instances and provide stable item identities.
- Grids and Wrap
Choose a scrollable grid for many items and Wrap for a small collection that should flow onto new lines.
- Scrolling and slivers
Combine a header and a long list in one CustomScrollView, and avoid accidental unbounded nested scrolling.
Forms and user input
Read input, validate a form and handle interaction with clear feedback.
- Text fields and controllers
Read a text field, choose between onChanged and a controller, and dispose resources in the widget that creates them.
- Form validation
Build a complete validated form, display actionable errors and separate client validation from server acceptance.
- Gestures and selection
Prefer semantic controls for ordinary actions, use GestureDetector for custom interaction and keep hit targets usable.
Material app structure and themes
Build page structure, feedback surfaces, consistent themes and asset configuration.
- Scaffold and feedback
Build a Material page and show a SnackBar from a context that belongs below the Scaffold.
- Themes and dark mode
Centralize colors and typography, follow system theme preferences and avoid unreadable hard-coded combinations.
- Dialogs and bottom sheets
Choose a feedback surface, return a dialog result and handle cancellation without assuming a value exists.
- Assets and fonts
Declare assets in pubspec.yaml, distinguish file names from asset keys and verify case-sensitive paths before release.