Skip to content

Feature descriptors ​

FeatureDescriptor is the app-facing description of a Flutter feature. The app supplies descriptors; the runtime initializes their hooks and collects their contributions.

How the pieces fit together

Identity ​

name identifies the feature and must be unique in the app. Dependency names refer to this value. title is the human-readable label. Optional description and icon help development tooling describe the feature.

Lifecycle ​

Use init for feature-owned setup after shared plugins and declared dependencies are ready. Use dispose to release subscriptions, controllers, and other resources the feature creates. Cleanup runs before plugins disappear.

Routes ​

routes returns the feature’s GoRouter route contributions. It can be synchronous or asynchronous. Keep the paths public and intentional when other features navigate into them.

Dependencies ​

List prerequisite descriptor names in dependencies. An app must include those descriptors. The runtime rejects missing dependencies and cycles. A dependency expresses initialization ordering; it does not import a Dart package for you.

Extensions ​

Use extensions to contribute to a registered extension builder. A descriptor declares the contribution; a builder aggregates contributions and owns the shared registry or behavior.

The complete API documents every directly declared property and constructor. Descriptors and builders explains the extension contract.

Lazy descriptors ​

LazyFeatureDescriptor declares metadata, route prefixes, dependencies, and a loader. Keep its name aligned with the loaded descriptor. Startup and lifecycle explains loading, retry, and readiness.