Merge branch 'master' into null_safety
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98418ae..bafa706 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.10.0-nnbd
+
+- Migrate to null safety.
+
## 1.9.2
Revert changes in `1.9.1` due to problems moving `unawaited` to `meta`.
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 29ad479..2036951 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -6,3 +6,6 @@
# including a list of lints that are intentionally _not_ enforced.
include: lib/analysis_options.yaml
+analyzer:
+ enable-experiment:
+ - non-nullable
diff --git a/example/example.dart b/example/example.dart
new file mode 100644
index 0000000..f2a2bd6
--- /dev/null
+++ b/example/example.dart
@@ -0,0 +1,16 @@
+import 'package:pedantic/pedantic.dart';
+
+void main() async {
+ // Normally, calling a function that returns a Future from an async method
+ // would require you to ignore the unawaited_futures lint with this analyzer
+ // syntax:
+ //
+ // ignore: unawaited_futures
+ doSomethingAsync();
+
+ // Wrapping it in a call to `unawaited` avoids that, since it doesn't
+ // return a Future. This is more explicit, and harder to get wrong.
+ unawaited(doSomethingAsync());
+}
+
+Future<void> doSomethingAsync() async {}
diff --git a/lib/pedantic.dart b/lib/pedantic.dart
index f6489f5..5276dc9 100644
--- a/lib/pedantic.dart
+++ b/lib/pedantic.dart
@@ -22,4 +22,4 @@
/// unawaited(log('Preferences saved!'));
/// }
/// ```
-void unawaited(Future<void> future) {}
+void unawaited(Future<void>? future) {}
diff --git a/pubspec.yaml b/pubspec.yaml
index c6efeb2..935a919 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,11 +1,8 @@
name: pedantic
-version: 1.9.2
+version: 1.10.0-nnbd
description: >-
The Dart analyzer settings and best practices used internally at Google.
homepage: https://github.com/dart-lang/pedantic
environment:
- sdk: '>=2.1.1 <3.0.0'
-
-dependencies:
- meta: ^1.2.2
+ sdk: '>=2.9.0-1 <2.9.0'