Intermediate Flutter

Connect screens and services. Manage state, validate remote data, store information and add purposeful animation.

Purpose of this learning path

Build a small app with navigation, predictable state and explicit loading, error and empty states.

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 small app with navigation, predictable state and explicit loading, error and empty states.

Navigation and routing

Move between screens, return results and choose an appropriate routing model.

  1. Navigator push and popOpen a second screen with MaterialPageRoute, use the route stack and let the platform back action return to the previous screen.
  2. Passing data and returning resultsPass typed inputs to a destination and await a nullable result without using a stale BuildContext after navigation.
  3. Routing and deep linksModel a screen as a route with stable parameters and understand direct navigation, unknown IDs and browser history.

Built-in state management

Choose state ownership before introducing listeners, notifiers or inherited dependencies.

  1. Local state with setStateUse setState for a small interaction and decide when state should move higher in the widget tree.
  2. Shared state with a notifierSeparate a small model from the interface using ChangeNotifier and rebuild only the dependent area.
  3. ValueNotifier and ValueListenableBuilderUse ValueNotifier and ValueListenableBuilder for a small observable value, with explicit lifecycle and immutable updates.
  4. Inherited dependenciesUnderstand how descendants find an ancestor dependency and why updateShouldNotify should reflect meaningful changes.

State management packages

Compare Provider, Riverpod and Bloc through data flow, ownership and testing requirements.

  1. Provider and ChangeNotifierUse Provider to manage a model scope, watch values during build and invoke actions from callbacks.
  2. Riverpod and NotifierUse a NotifierProvider with a focused state API, and distinguish ref.watch from ref.read in a consumer.
  3. Bloc and CubitCompare Cubit methods with Bloc events, expose immutable state and keep one-time effects separate from rendering.
  4. Choosing state managementCompare local state, Provider, Riverpod and Bloc using scope, asynchronous behavior, testability and team requirements.

APIs, JSON and async UI

Handle requests, validate JSON and represent loading, failure, pagination and success.

  1. Async UI statesUse FutureBuilder with a stable future and make every visible asynchronous state understandable.
  2. JSON and model boundariesValidate decoded JSON and create typed Dart objects before using remote data inside widgets.
  3. HTTP requests and failuresSeparate request execution from JSON parsing, inspect response status and make timeout behavior explicit.
  4. Pagination and incremental loadingTrack an in-flight request, page cursor and end-of-list state while preserving already loaded items after a later failure.

Local storage and cloud data

Choose persistence by data shape, consistency requirements and platform support.

  1. Preferences and settingsStore a small non-sensitive preference, use the async preferences API and keep persistence separate from interface state.
  2. SQLite and repositoriesModel persistent records with stable IDs, parameterize SQL and hide database access behind a repository contract.
  3. Firebase and cloud dataSeparate signed-in identity from database authorization, and initialize Firebase through the official project tooling.

Animations and custom drawing

Use implicit animation for state transitions and controllers for explicit timing.

  1. Implicit animationsAnimate between visual states with AnimatedContainer and keep application meaning independent of animation timing.
  2. Explicit animation controllersCreate a controller in State, drive a visual transition and dispose the ticker-owning resource correctly.
  3. CustomPaint and canvasDraw a small data-driven graphic, separate the painter from business logic and implement shouldRepaint meaningfully.

Flutter for web

Browser setup, responsive interfaces, URLs, Wasm and production deployment.

  1. Run Flutter in a browserCreate a web-enabled Flutter project and verify a browser target before changing app code.
  2. Responsive browser UIBuild for the available width and verify keyboard, pointer and browser zoom behavior.
  3. URLs and deep linksUnderstand hash and path navigation, then verify a nested URL on your real hosting configuration.
  4. Wasm and deferred loadingBuild for Wasm, verify the runtime and evaluate opt-in deferred loading with real network measurements.
  5. Deploy to shared hostingPrepare a subfolder build, scope URL fallback rules and verify caching without replacing your existing website.

Find your next idea

Search lessons, code examples and projects.

Type a few words to start exploring.