cobalt_annotations 0.1.2 copy "cobalt_annotations: ^0.1.2" to clipboard
cobalt_annotations: ^0.1.2 copied to clipboard

Annotations for Cobalt — @CobaltInject, @injected, @CobaltBootstrap, @CobaltInit and @CobaltScopeRoot.

cobalt_annotations #

Annotations for Cobalt, a dependency injection framework for Dart and Flutter.

This package holds nothing but the annotations, so neither the runtime nor the analyzer leaks into a dependency graph that only needs the markers. Most applications depend on cobalt instead, which re-exports everything here.

Annotation Applies to Effect
@CobaltInject / @cobaltInject class registers the class; lifetime, name, exposeAs
@cobaltSingleton / @cobaltTransient class shorthands for the other two lifetimes
@Injected / @injected late final field fills the field through the generated mixin
@Named parameter or field selects a named registration
@CobaltParam / @cobaltParam constructor parameter the call site supplies it, not the graph
@CobaltBootstrap class a phase-0 step, run before the container exists
@CobaltInit class an async singleton, with dependsOn
@CobaltModule / @cobaltModule class its annotated members register types you do not own
@CobaltScopeRoot class names the root scope; provides declares registrations made by hand
CobaltProvided inside provides a hand-made registration that carries a @Named qualifier
@CobaltEnvironment class optional — restricts the registration to an environment; repeat it for several
0
likes
160
points
227
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Annotations for Cobalt — @CobaltInject, @injected, @CobaltBootstrap, @CobaltInit and @CobaltScopeRoot.

Repository (GitHub)
View/report issues

Topics

#dependency-injection #annotations #codegen #di

License

MIT (license)

Dependencies

meta

More

Packages that depend on cobalt_annotations