OLD | NEW |
| 1 ## 1.1.0 |
| 2 * Introduce `@alwaysThrows` to declare that a function always throws |
| 3 (SDK issue [17999](https://github.com/dart-lang/sdk/issues/17999)). This |
| 4 is first available in Dart SDK 1.25.0-dev.1.0. |
| 5 |
| 6 ```dart |
| 7 import 'package:meta/meta.dart'; |
| 8 |
| 9 // Without knowing that [failBigTime] always throws, it looks like this |
| 10 // function might return without returning a bool. |
| 11 bool fn(expected, actual) { |
| 12 if (expected != actual) |
| 13 failBigTime(expected, actual); |
| 14 else |
| 15 return True; |
| 16 } |
| 17 |
| 18 @alwaysThrows |
| 19 void failBigTime(expected, actual) { |
| 20 throw new StateError('Expected $expected, but was $actual.'); |
| 21 } |
| 22 ``` |
| 23 |
1 ## 1.0.4 | 24 ## 1.0.4 |
2 * Introduce `@virtual` to allow field overrides in strong mode | 25 * Introduce `@virtual` to allow field overrides in strong mode |
3 (SDK issue [27384](https://github.com/dart-lang/sdk/issues/27384)). | 26 (SDK issue [27384](https://github.com/dart-lang/sdk/issues/27384)). |
4 | 27 |
5 ```dart | 28 ```dart |
6 import 'package:meta/meta.dart' show virtual; | 29 import 'package:meta/meta.dart' show virtual; |
7 class Base { | 30 class Base { |
8 @virtual int x; | 31 @virtual int x; |
9 } | 32 } |
10 class Derived extends Base { | 33 class Derived extends Base { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 constructor must use the keyword `const` unless one or more of the | 87 constructor must use the keyword `const` unless one or more of the |
65 arguments to the constructor is not a compile-time constant. | 88 arguments to the constructor is not a compile-time constant. |
66 | 89 |
67 ## 0.9.0 | 90 ## 0.9.0 |
68 * Introduce `@protected` annotation for members that must only be called from | 91 * Introduce `@protected` annotation for members that must only be called from |
69 instance members of subclasses. | 92 instance members of subclasses. |
70 * Introduce `@required` annotation for optional parameters that should be treate
d | 93 * Introduce `@required` annotation for optional parameters that should be treate
d |
71 as required. | 94 as required. |
72 * Introduce `@mustCallSuper` annotation for methods that must be invoked by all | 95 * Introduce `@mustCallSuper` annotation for methods that must be invoked by all |
73 overriding methods. | 96 overriding methods. |
OLD | NEW |