|
1 |
| -// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 1 | +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a
|
3 | 3 | // BSD-style license that can be found in the LICENSE file.
|
4 | 4 |
|
5 |
| -/// Constants and functions that developers can use to express the intentions |
6 |
| -/// that otherwise can't be deduced by statically analyzing the source code. |
| 5 | +/// Constants for use in metadata annotations. |
7 | 6 | ///
|
8 | 7 | /// See also `@deprecated` and `@override` in the `dart:core` library.
|
9 | 8 | ///
|
|
13 | 12 | /// function's name differently.
|
14 | 13 | ///
|
15 | 14 | /// For information on installing and importing this library, see the [meta
|
16 |
| -/// package on pub.dev](https://pub.dev/packages/meta). For examples of using |
| 15 | +/// package on pub.dev](https://pub.dev/packages/meta). For examples of using |
17 | 16 | /// annotations, see
|
18 | 17 | /// [Metadata](https://dart.dev/guides/language/language-tour#metadata) in the
|
19 | 18 | /// language tour.
|
@@ -267,26 +266,6 @@ const _VisibleForOverriding visibleForOverriding = _VisibleForOverriding();
|
267 | 266 | /// library which is in the `test` folder of the defining package.
|
268 | 267 | const _VisibleForTesting visibleForTesting = _VisibleForTesting();
|
269 | 268 |
|
270 |
| -/// Indicates to tools that [future] is intentionally not `await`-ed. |
271 |
| -/// |
272 |
| -/// In an `async` context, it is normally expected that all [Future]s are |
273 |
| -/// awaited, and that is the basis of the lint `unawaited_futures`. However, |
274 |
| -/// there are times where one or more futures are intentionally not awaited. |
275 |
| -/// This function may be used to ignore a particular future. It silences the |
276 |
| -/// `unawaited_futures` lint. |
277 |
| -/// |
278 |
| -/// ``` |
279 |
| -/// Future<void> saveUserPreferences() async { |
280 |
| -/// await _writePreferences(); |
281 |
| -/// |
282 |
| -/// // While 'log' returns a Future, the consumer of 'saveUserPreferences' |
283 |
| -/// // is unlikely to want to wait for that future to complete; they only |
284 |
| -/// // care about the preferences being written). |
285 |
| -/// unawaited(log('Preferences saved!')); |
286 |
| -/// } |
287 |
| -/// ``` |
288 |
| -void unawaited(Future<void>? future) {} |
289 |
| - |
290 | 269 | /// Used to annotate a class.
|
291 | 270 | ///
|
292 | 271 | /// See [immutable] for more details.
|
|
0 commit comments