Bind<T extends Object> class
Constructors
-
Bind(T factoryFunction(Injector i), {bool isSingleton = true, bool isLazy = true, bool export = false, bool isScoped = false, void onDispose(T value)?})
-
Properties
-
alwaysSerialized
→ bool
-
flag for indicate serialization
finalinherited
-
bindType
→ Type
-
no setterinherited
-
export
→ bool
-
export bind for others modules
This bind can only be accessed when imported by a module.
finalinherited
-
factoryFunction
→ T Function(Injector i)
-
finalinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
isLazy
→ bool
-
When 'true', the object is instantiated only the first time it is called.
When 'false', the object is instantiated along with the module.
finalinherited
-
isScoped
→ bool
-
create single instance for request
finalinherited
-
isSingleton
→ bool
-
single instance
finalinherited
-
onDispose
→ void Function(T value)?
-
Called in module`s dispose.
finalinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
selector
→ dynamic Function(T value)?
-
Generate reactive object
finalinherited
Static Methods
-
factory<T extends Object>(T inject(Injector i), {bool export = false})
→ Bind<T>
-
Bind a factory. Always a new constructor when calling Modular.get
-
instance<T extends Object>(T instance, {bool export = false})
→ Bind<T>
-
Bind an already exist 'Instance' of object..
-
scoped<T extends Object>(T inject(Injector i), {bool export = false, void onDispose(T)?})
→ Bind<T>
-
Create single instance for request.
-
singleton<T extends Object>(T inject(Injector i), {bool export = false, void onDispose(T)?})
→ Bind<T>
-
Bind a 'Singleton' class.
Built together with the module.
The instance will always be the same.