Flutter basics

Set up your tools, understand the widget tree and build accessible layouts with familiar Material components.

Purpose of this learning path

Build a multi-section screen, collect input and explain the lifecycle of its widgets.

How to study this section

Read the chapters in the listed order when learning the subject for the first time. For a reference lookup, choose the exact subtopic instead. Predict what the example will do, run or inspect it, then complete the exercise before moving on.

Configuration examples belong in a local project. The browser editor is available only for complete examples that can run without native platform access.

What this section covers

Build a multi-section screen, collect input and explain the lifecycle of its widgets.

Getting started: setup and first app

Understand Flutter, install the toolchain and create a project you can explain.

  1. What is Flutter?Understand the difference between the Flutter SDK, framework, engine and Dart, and choose an appropriate first project.
  2. Download Flutter SDKChoose a stable Flutter SDK for your operating system and CPU architecture, understand what the download contains and verify the installed toolchain.
  3. Install Flutter on WindowsInstall the SDK on Windows, configure PATH safely, compare terminal and editor SDK selection, and verify a clean development environment.
  4. Install Flutter on macOS or LinuxExtract the correct host SDK, configure the shell environment, verify executable selection and distinguish host setup from platform setup.
  5. Flutter editor setupConnect an editor to the intended Flutter SDK, install the official language support and verify debugging against a real target.
  6. Flutter Android setupConfigure Android development tools, select a compatible Java runtime, detect an emulator or physical device and verify a Flutter run.
  7. Flutter iOS setupPrepare a supported macOS/Xcode environment, verify command-line tool selection and distinguish simulator runs from signed device releases.
  8. Verify setup with flutter doctorInstall the Flutter SDK, inspect PATH and flutter doctor output, and verify the exact target platform you intend to use.
  9. Create and run a Flutter projectCreate a new Flutter app, resolve packages, select a detected target and verify analysis, tests and interaction.
  10. Project and toolsFind the files you will edit most often, create a local project and distinguish hot reload from hot restart.
  11. Your first Flutter appBuild a small Flutter counter and understand the path from main() to a screen that responds to a tap.
  12. Hot reload and restartUnderstand which changes preserve in-memory state, which need a Dart restart and which require rebuilding the platform app.

Flutter widgets

Understand composition, lifecycle and the widgets used to display content and handle actions.

  1. Compose small widgetsBuild a reusable stateless profile card with explicit inputs and a clear responsibility.
  2. State and lifecycleUnderstand StatefulWidget, initState and dispose, and pair resource creation with cleanup.
  3. Text and typographyStyle text through the theme, handle constrained labels and preserve readability when text size increases.
  4. Buttons and actionsChoose FilledButton, OutlinedButton and IconButton by action importance, and disable actions while they are unavailable.
  5. Images and iconsReserve image space, provide a useful failure state and configure local assets without layout shifts.
  6. Containers and spacingSeparate decoration, constraints and spacing instead of reaching for a Container around every widget.
  7. BuildContext and keysDistinguish 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.

  1. Rows, columns and constraintsUnderstand how parent constraints, child sizes and Expanded work together in a Flutter layout.
  2. Responsive screensUse LayoutBuilder to choose a practical layout without assuming every device has the same screen width.
  3. Stack and PositionedLayer content deliberately, choose a bounded parent and avoid using absolute positioning for an entire responsive screen.
  4. ListView and lazy item buildingBuild visible list items on demand, keep state out of temporary row instances and provide stable item identities.
  5. Grids and WrapChoose a scrollable grid for many items and Wrap for a small collection that should flow onto new lines.
  6. Scrolling and sliversCombine a header and a long list in one CustomScrollView, and avoid accidental unbounded nested scrolling.

Material app structure and themes

Build page structure, feedback surfaces, consistent themes and asset configuration.

  1. Scaffold and feedbackBuild a Material page and show a SnackBar from a context that belongs below the Scaffold.
  2. Themes and dark modeCentralize colors and typography, follow system theme preferences and avoid unreadable hard-coded combinations.
  3. Dialogs and bottom sheetsChoose a feedback surface, return a dialog result and handle cancellation without assuming a value exists.
  4. Assets and fontsDeclare assets in pubspec.yaml, distinguish file names from asset keys and verify case-sensitive paths before release.

Forms and user input

Read input, validate a form and handle interaction with clear feedback.

  1. Text fields and controllersRead a text field, choose between onChanged and a controller, and dispose resources in the widget that creates them.
  2. Form validationBuild a complete validated form, display actionable errors and separate client validation from server acceptance.
  3. Gestures and selectionPrefer semantic controls for ordinary actions, use GestureDetector for custom interaction and keep hit targets usable.

Find your next idea

Search lessons, code examples and projects.

Type a few words to start exploring.