value property
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.
Implementation
final String value;