@visibleForTestingannotation for declarations that may be referenced only in the library or in a test.
@factoryto allow statics and methods returning
- First stable API release.
@protectedto include implemented interfaces (linter#252).
- Fixed markdown in dartdocs.
@optionalTypeArgsannotation for classes whose type arguments are to be treated as optional.
- Added new
Requiredconstructor with a means to specify a reason to explain why a parameter is required.
@factoryannotation for methods that must either be abstract or must return a newly allocated object.
@literalannotation that indicates that any invocation of a constructor must use the keyword
constunless one or more of the arguments to the constructor is not a compile-time constant.
@protectedannotation for members that must only be called from instance members of subclasses.
@requiredannotation for optional parameters that should be treated as required.
@mustCallSuperannotation for methods that must be invoked by all overriding methods.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: meta: ^1.0.2
2. Install it
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use: