Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kikuchy/dart_non_null
Annotation to express that arguments or returned values are not nullable.
https://github.com/kikuchy/dart_non_null
Last synced: 1 day ago
JSON representation
Annotation to express that arguments or returned values are not nullable.
- Host: GitHub
- URL: https://github.com/kikuchy/dart_non_null
- Owner: kikuchy
- License: apache-2.0
- Created: 2018-09-11T09:09:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T09:22:22.000Z (over 6 years ago)
- Last Synced: 2024-12-20T05:02:56.658Z (6 days ago)
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/non_null
- Size: 4.88 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NonNull Annotaion
Only annotaion `@non_null`.
Use it to specify arguments or returned values are not nullable.You should not give `null` to `@non_null` annotated arguments.
And you should expect returned values from `@non_null` annotated functions or methods.It expects to be used by linters, [`source_gen`](https://pub.dartlang.org/packages/source_gen) Generators or something else.
## Example
See [example/main.dart](example/main.dart).
```dart
import 'package:non_null/non_null.dart';@non_null
String foo(@non_null bar) {
return "FOO $bar";
}void main() {
// `value` is not null (if you believe annotation).
// And DON'T give `null` to foo's argument.
final value = foo("BAR");
print(value);
}
```
# LicenseNonNull Annotation by kikuchy is licensed under the Apache License, Version2.0