@@ -74,10 +74,9 @@ class Deprecated {
7474 /// expiration of the annotated feature.
7575 ///
7676 /// The [message] is displayed as part of the warning. The message should be
77- /// aimed at the programmer who owns the extending class, and should
78- /// recommend an alternative (if available), and say when this functionality
79- /// is expected to be removed if that is sooner or later than the next major
80- /// version.
77+ /// aimed at the programmer using the annotated feature, and should recommend
78+ /// an alternative (if available), and say when this feature is expected to
79+ /// be removed if that is sooner or later than the next major version.
8180 const Deprecated (this .message) : _kind = _DeprecationKind .use;
8281
8382 /// Creates an annotation which deprecates implementing a class or mixin.
@@ -187,6 +186,25 @@ class Deprecated {
187186 /// or later than the next major version.
188187 const Deprecated .mixin ([this .message]) : _kind = _DeprecationKind .mixin ;
189188
189+ /// Creates an annotation which deprecates omitting an argument for the
190+ /// annotated parameter.
191+ ///
192+ /// The annotation can be used on optional parameters of methods,
193+ /// constructors, or top-level functions, indicating the parameter will be
194+ /// required in a later release.
195+ ///
196+ /// Any call to a function which does not pass a value for the annotated
197+ /// parameter will cause a warning that such omission is deprecated.
198+ ///
199+ /// The annotation is not inherited in method overrides.
200+ ///
201+ /// The [message] , if given, is displayed as part of the warning. The message
202+ /// should be aimed at the programmer who is calling the function with the
203+ /// annotated parameter, and should recommend an alternative (if available),
204+ /// and say when this functionality is expected to be removed if that is
205+ /// sooner or later than the next major version.
206+ const Deprecated .optional ([this .message]) : _kind = _DeprecationKind .optional;
207+
190208 String toString () => "Deprecated feature: $message " ;
191209}
192210
@@ -201,7 +219,15 @@ const Deprecated deprecated = Deprecated("next release");
201219///
202220/// This enum can be private because the information is only intended for
203221/// static tooling, such as the analyzer. Values may be added.
204- enum _DeprecationKind { use, implement, extend, subclass, instantiate, mixin }
222+ enum _DeprecationKind {
223+ use,
224+ implement,
225+ extend,
226+ subclass,
227+ instantiate,
228+ mixin ,
229+ optional,
230+ }
205231
206232class _Override {
207233 const _Override ();
0 commit comments