ConditionalOnMissingBean class

Register bean only if no bean of the specified type exists

Example:

@Service()
@ConditionalOnMissingBean(UserService)
class DefaultUserService implements UserService {
  // Only registered if no other UserService bean exists
}
Inheritance

Constructors

ConditionalOnMissingBean(Type type, {String? qualifier})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
qualifier String?
Optional qualifier to check for
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
The type to check for
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.
inherited