meta 1.2.4
meta: ^1.2.4 copied to clipboard
This library contains the declarations of annotations that developers can use to express the intentions that otherwise can't be deduced by statically analyzing the source code. These annotations are i [...]
1.2.4 #
- Introduce
@internalto annotate elements that should not be used outside of the package in which the element is declared.
1.2.3 #
- Added a
Targetannotation that allows other annotations to specify what kinds of declarations they can validly be applied to.
1.2.2 #
- Removed
unawaitedbecause the attempt to move it frompackage:pedanticcaused too many issues. If you see errors aboutunawaitedbeing declared in two places, please update the version constraints formetato1.2.2or later.
1.2.1 #
- Fixed a bug by adding an import of dart:async so that the code really is compatible with the lower bound of the SDK constraints.
1.2.0 #
- Introduce
@doNotStoreto annotate methods, getters and functions to indicate that values obtained by invoking them should not be stored in a field or top-level variable. - Introduce
unawaitedto mark invocations that return aFuturewhere it's intentional that the future is not being awaited. (Moved frompackage:pedantic.)
1.1.8 #
- Introduce
@nonVirtualto annotate instance members that should not be overridden in subclasses or when mixed in.
1.1.7 #
-
Introduce
@sealedto declare that a class or mixin is not allowed as a super-type.Only classes in the same package as a class or mixin annotated with
@sealedmay extend, implement or mix-in the annotated class or mixin. (SDK issue 27372).
1.1.6 #
- Set max SDK version to <3.0.0.
1.1.5 #
- Introduce @isTest and @isTestGroup to declare a function that is a test, or a test group.
1.1.4 #
- Added dart2js.dart.
1.1.2 #
- Rollback SDK constraint update for 2.0.0. No longer needed.
1.1.1 #
- Update SDK constraint to be 2.0.0 dev friendly.
1.1.0 #
-
Introduce
@alwaysThrowsto declare that a function always throws (SDK issue 17999). This is first available in Dart SDK 1.25.0-dev.1.0.import 'package:meta/meta.dart'; // Without knowing that [failBigTime] always throws, it looks like this // function might return without returning a bool. bool fn(expected, actual) { if (expected != actual) failBigTime(expected, actual); else return True; } @alwaysThrows void failBigTime(expected, actual) { throw new StateError('Expected $expected, but was $actual.'); }
1.0.5 #
- Introduce
@experimentalto annotate a library, or any declaration that is part of the public interface of a library (such as top-level members, class members, and function parameters) to indicate that the annotated API is experimental and may be removed or changed at any-time without updating the version of the containing package, despite the fact that it would otherwise be a breaking change.
1.0.4 #
-
Introduce
@virtualto allow field overrides in strong mode (SDK issue 27384).import 'package:meta/meta.dart' show virtual; class Base { @virtual int x; } class Derived extends Base { int x; // Expose the hidden storage slot: int get superX => super.x; set superX(int v) { super.x = v; } }
1.0.3 #
-
Introduce
@checkedto override a method and tighten a parameter type (SDK issue 25578).import 'package:meta/meta.dart' show checked; class View { addChild(View v) {} } class MyView extends View { // this override is legal, it will check at runtime if we actually // got a MyView. addChild(@checked MyView v) {} } main() { dynamic mv = new MyView(); mv.addChild(new View()); // runtime error }
1.0.2 #
- Introduce
@visibleForTestingannotation for declarations that may be referenced only in the library or in a test.
1.0.1 #
- Updated
@factoryto allow statics and methods returningnull.
1.0.0 #
- First stable API release.
0.12.2 #
- Updated
@protectedto include implemented interfaces (linter#252).
0.12.1 #
- Fixed markdown in dartdocs.
0.12.0 #
- Introduce
@optionalTypeArgsannotation for classes whose type arguments are to be treated as optional.
0.11.0 #
- Added new
Requiredconstructor with a means to specify a reason to explain why a parameter is required.
0.10.0 #
- Introduce
@factoryannotation for methods that must either be abstract or must return a newly allocated object. - Introduce
@literalannotation that indicates that any invocation of a constructor must use the keywordconstunless one or more of the arguments to the constructor is not a compile-time constant.
0.9.0 #
- Introduce
@protectedannotation for members that must only be called from instance members of subclasses. - Introduce
@requiredannotation for optional parameters that should be treated as required. - Introduce
@mustCallSuperannotation for methods that must be invoked by all overriding methods.