Description class

Provides a human-readable description of a class or method.

This annotation is often paired with @Role to give additional context to maintainers, API documentation tools, or automated diagram generators.

Example

@Role(DesignRole.service)
@Description('Handles user-related business operations')
class UserService {
  Future<User> findById(String id) {
    // business logic here
  }
}

@Role(DesignRole.controller)
@Description('REST API endpoint for user management')
class UserController {
  final UserService service;

  UserController(this.service);

  @Get('/users/:id')
  @Description('Fetches a user by its unique identifier')
  Future<User> getUser(String id) => service.findById(id);
}

Tip: Use @Description to generate structured documentation or to improve readability in IDE tooling.

Annotations
  • @Target.new({TargetKind.classType, TargetKind.method})

Constructors

Description(String value)
Provides a human-readable description of a class or method.
const

Properties

annotationType Type
Returns the annotation _type of this annotation.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
Provides a human-readable description of a class or method.
final

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
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.

Operators

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