# Autowired class

Autowired annotation for dependency injection

This annotation marks a field, setter, or constructor for automatic dependency injection.

Example Usage:

    @Service()
    class OrderService {
      @Autowired()
      late UserService userService;

      @Autowired()
      late PaymentService paymentService;

      @Autowired()
      late InventoryService? inventoryService;

      // Constructor injection (preferred)
      OrderService();

      Future<Order> createOrder(CreateOrderRequest request) async {
        final user = await userService.findById(request.userId);
        await inventoryService.reserveItems(request.items);
        final payment = await paymentService.processPayment(request.payment);

        return Order(
          id: generateId(),
          userId: user.id,
          items: request.items,
          payment: payment,
          createdAt: DateTime.now(),
        );
      }
    }

Inheritance
  - Object
  - ReflectableAnnotation
  - Autowired
Annotations
  - @Target({TargetKind.field})

## Constructors

Autowired.new()
  Autowired annotation for dependency injection
  const

## Properties

annotationType → Type
  Returns the annotation _type of this annotation.
  no setter override
hashCode → int
  Returns a hash code consistent with equality definition.
  no setter inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited

## Methods

equals(Object other) → bool
  Checks whether the given object is logically equivalent to this annotation.
  inherited
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
toString() → String
  Returns a string representation of this annotation.
  inherited

## Operators

operator ==(Object other) → bool
  Checks if this annotation is equal to another object.
  inherited