Skip to content

Commit 1ec0416

Browse files
committed
+feat: Add more annotations
1 parent 432f05e commit 1ec0416

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

example/example.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:df_safer_dart_annotations/df_safer_dart_annotations.dart';
22

3+
// ignore: deprecated_member_use_from_same_package
34
@mustHandleReturn
45
String whatIsYourName() {
56
return 'Tony';

lib/src/_src.g.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
88
//.title~
99

10-
export './annotations/must_handle_return_annotation.dart';
10+
export './annotations/no_futures_allowed_annotation.dart';
11+
export './annotations/must_await_all_futures_annotation.dart';
12+
export './annotations/must_handle_return_annotation.dart';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//.title
2+
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3+
//
4+
// Dart/Flutter (DF) Packages by dev-cetera.com & contributors. The use of this
5+
// source code is governed by an MIT-style license described in the LICENSE
6+
// file located in this project's root directory.
7+
//
8+
// See: https://opensource.org/license/mit
9+
//
10+
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
11+
//.title~
12+
13+
const mustAwaitAllFutures = MustAwaitAllFuturesAnnotation();
14+
15+
/// The class that enables the `@mustAwaitAllFutures` annotation.
16+
final class MustAwaitAllFuturesAnnotation {
17+
const MustAwaitAllFuturesAnnotation();
18+
}

lib/src/annotations/must_handle_return_annotation.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
/// safeDivide(10, 0);
4242
/// }
4343
/// ```
44+
@Deprecated('Use @useResult instead.')
4445
const mustHandleReturn = MustHandleReturnAnnotation();
4546

4647
/// The class that enables the `@mustHandleReturn` annotation.
48+
@Deprecated('Use @useResult instead.')
4749
final class MustHandleReturnAnnotation {
4850
const MustHandleReturnAnnotation();
4951
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//.title
2+
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3+
//
4+
// Dart/Flutter (DF) Packages by dev-cetera.com & contributors. The use of this
5+
// source code is governed by an MIT-style license described in the LICENSE
6+
// file located in this project's root directory.
7+
//
8+
// See: https://opensource.org/license/mit
9+
//
10+
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
11+
//.title~
12+
13+
const noFuturesAllowed = NoFuturesAllowedAnnotation();
14+
15+
/// The class that enables the `@noFuturesAllowed` annotation.
16+
final class NoFuturesAllowedAnnotation {
17+
const NoFuturesAllowedAnnotation();
18+
}

0 commit comments

Comments
 (0)