service_container library

Provide a services container.

Not like dart_service_provider, the service container get a service without enumerate the services descriptors.

Classes

ConsoleColor
Console ansi color helper
ConsoleColors
ConsoleLogPrinter
The default LogPrinter for console
ContainerConfigure
Service container configuration.
IAsyncDisposable
Used to release resources asynchronously.
IDisposable
Indicates the interface for which resources need to be released.
IServiceProvider
Service provider interface
IServiceScope
Service scope
IServiceScopeFactory
Service Scope Factory
LogPrinter
support to print logs that published by dart:logging package.
ScopedDescriptor<T>
Scoped descriptor
ScopedFutureDescriptor<T>
Scoped future descriptor that supports asynchronous initialization.
ServiceDescriptor<T>
Describe a service
ServiceProvider
Represents the root service provider, it's a IServiceScopeFactory too.
SingletonDescriptor<T>
Singleton descriptor
SingletonFutureDescriptor<T>
Singleton future descriptor that supports asynchronous initialization.
TransientDescriptor<T>
Transient descriptor
TransientFutureDescriptor<T>
Transient future descriptor that supports asynchronous initialization.

Enums

ServiceLifeTime
Service life-time

Extensions

ConsoleColorExtensions on ConsoleColor
Provide additional methods
ServiceContainerLogging on ContainerConfigure
Config service container's logging.
ServiceProviderExtensions on IServiceProvider
Extension methods for IServiceProvider

Constants

containerConfigure → const ContainerConfigure
A const instance of ContainerConfigure

Properties

$LogPrinter ServiceDescriptor<LogPrinter>
dart:logging package's log printer.
getter/setter pair

Typedefs

ServiceFactory<T> = T Function(IServiceProvider p)
Service factory.