Tutorials

Ark DI tutorials

Build complete pure-Dart and Flutter composition flows with explicit ownership.

v1.1.0Beginner

Ark DI tutorials

Read Composition Root and Registrations and ownership before starting. The tutorials use constructor injection inside application objects; container resolution appears only at composition boundaries.

Choose a scenario

  1. Build a pure-Dart object graph — create async infrastructure, Repository, and service registrations; resolve the application entry point; override a bounded preview graph; verify teardown order.
  2. Scope a Flutter application — expose an application container, create a shorter-lived feature Scope, select the correct BuildContext API, and keep Widget-owned state outside DI.

Start with the Dart tutorial even for a Flutter application. ark_di_flutter adapts container ownership to the widget tree but does not change registration and resolution semantics.