Component class final

Marks a class as a general component in the application.

Components are general-purpose classes that can be registered in the dependency injection container. Use this annotation for classes that don't fit into more specific categories like Service or Repository.

Example:

@Component()
class EmailFormatter {
  String format(String email) => email.toLowerCase();
}
Implemented types

Constructors

Component([bool registerWithInterfaceOrSuperType = true])
Creates a Component annotation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
registerWithInterfaceOrSuperType bool
Determines if the component should be registered with its interface or supertype.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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