Alle Anleitungen

Service maps

Register services that live in a third party package you cannot annotate.

If you depend on a third party package, you can not easily add the @Service to classes inside the package. For this, there is a @ServiceMap annotation, that accepts a map of services.

@ServiceMap(services: {
  ManuallyWiredServiceImplementation: Service(
    lifetime: ServiceLifetime.transient, // optional
    exposeAs: ManuallyWiredService, // optional
  ),
})
void main() {}
Diese Seite auf GitHub bearbeiten