DCM is an advanced linter for Dart and Flutter that helps you analyze and improve your code quality. You can find all available lint rules here.
@Throws()
Used to annotate getters, methods, functions, parameters or local variables that can throw an exception (or multiple exceptions/errors) and therefore an invocation of such declarations must explicitly handle that exception.
Used to annotate parameters or variables that are changed/updated within the function/method body.
For example, the avoid-collection-mutating-methods and avoid-mutating-parameters rules will not trigger on annotated parameters and avoid-not-assignable-collection-types will include such parameters into its analysis.
DCM will provide feedback if the @mutated annotation is missing or unnecessary.
For more information, see the documentation for prefer-correct-mutated and other rules mentioned above.
How to use annotations
Take these steps to use annotations:
Install this package as a regular dependency:
dart pub add dart_code_metrics_annotations
or:
flutter pub add dart_code_metrics_annotations
Enable rules that rely on DCM annotations and add those annotations to your code.