When i have a custom annotation like this:
class FieldAnnotation{
const FieldAnnotation();
}
How do i restrict the usage of that annotation to only be applied on fields. Specifically, how do i generate a warning or an error on static analysis?
@FieldAnnotation() // should show a warning or an error
class Test{
@FieldAnnotation() // should have no problems
final String id;
Test({required this.id});
}