# TargetType<T> class final

TargetType Annotation

A reflectable annotation used to declare and resolve a target class type, optionally constrained by a package name.

# Purpose

- Acts as a metadata marker on pods, fields, or parameters to indicate a specific type target.
- Useful for frameworks that need to resolve generic or inferred types at runtime (e.g., injection points).

# Behavior

- Stores an optional packageName.
- Provides a get method that constructs a Class<T> reference.
  - If packageName is specified, the class is resolved within that package.
  - Otherwise, a generic Class<T> reference is created.

# Example

    @TargetType("package:example/test.dart.services")
    final TargetType<Service> serviceType = TargetType();

    final clazz = serviceType.get();
    print(clazz.getQualifiedName()); // package:example/test.dart.services.Service

# Notes

- The annotation type is self-describing via annotationType.
- Works in tandem with reflective class loaders to identify targets.

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

## Constructors

TargetType.new([String? packageName])
  TargetType Annotation
  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
packageName → String?
  The optional package name for resolving the target type.
  final
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
get() → Class<T>
  Resolves the target type into a Class<T> representation.
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