kfx_dependency_injection library

Classes

IInitializable
When a service implements this interface, the method initialize will be called when the ServiceProvider instantiates a new instance
IMustBeSingleton
IMustBeTransient
IPlatformInfo
PlatformInfo
Holds information about the current platform and host.
ServiceProvider
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.

Enums

NativePlatform
The app is running as a native app in one of these OSes or is Flutter Web?
PlatformDesignSystem
The design system used by the platform host
PlatformHost
After considering PlatformMedia, which host is running the app?
PlatformMedia
What kind of platform the app is running?

Typedefs

InjectorDelegate<TService> = TService Function(TConcrete? optional<TConcrete>(), TConcrete required<TConcrete>(), PlatformInfo platform)

Exceptions / Errors

InvalidRegistrationModalForTypeException
This exception is thrown when you try to register a service that implements IMustBeTransient as singleton or IMustBeSingleton as transient.
RegistryMustBeSingletonException
This exception is thrown when you try to register a service that implements IMustBeTransient as transient.
RegistryMustBeTransientException
This exception is thrown when you try to register a service that implements IMustBeTransient as singleton.
ServiceAlreadyRegisteredException
This exception is thrown when you try to register a service with the same name twice.
ServiceInvalidInferenceException
This exception is thrown when you try to use a service provider method without specifying the TService generic argument, so the Service Provider cannot know what type to return
ServiceNotRegisteredException
This exception is thrown when you try to get a required service from ServiceProvider and the service was not registered.