Bean class

Field and method annotation for defining service beans.

Beans are a lightweight and easy-to-use form of dependency providers, which are published by services. Instance methods of services can be annotated with this annotation to create a bean. Static methods and methods with arguments can't be registered as beans.

Constructors

Bean({String? name, LoadingStrategy strategy = LoadingStrategy.direct, bool isUnnamed = false, Type? bindingType})
const

Properties

bindingType Type?
Sets the type to which this bean is bound. The type specified must be of the same type as or a supertype of the returned object.
final
hashCode int
The hash code for this object.
no setteroverride
isUnnamed bool
Disables name binding making the bean injectable just by its type.
final
name String?
Defines the name of the bean. This value will be ignored when isUnnamed is true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strategy → LoadingStrategy
Defines the loading strategy for this bean, influencing when and if the result of this method invocation will be cached.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override