[connectivity] Fix unawaited futures (#2313)
diff --git a/packages/connectivity/CHANGELOG.md b/packages/connectivity/CHANGELOG.md index 0e1ea81..124b2a3 100644 --- a/packages/connectivity/CHANGELOG.md +++ b/packages/connectivity/CHANGELOG.md
@@ -1,3 +1,7 @@ +## 0.4.5+7 + +* Fix unawaited futures in the example app and tests. + ## 0.4.5+6 * Fix singleton Reachability problem on iOS.
diff --git a/packages/connectivity/analysis_options.yaml b/packages/connectivity/analysis_options.yaml deleted file mode 100644 index 22c4e10..0000000 --- a/packages/connectivity/analysis_options.yaml +++ /dev/null
@@ -1,10 +0,0 @@ -# This is a temporary file to allow us to land a new set of linter rules in a -# series of manageable patches instead of one gigantic PR. It disables some of -# the new lints that are already failing on this plugin, for this plugin. It -# should be deleted and the failing lints addressed as soon as possible. - -include: ../../analysis_options.yaml - -analyzer: - errors: - unawaited_futures: ignore
diff --git a/packages/connectivity/example/lib/main.dart b/packages/connectivity/example/lib/main.dart index c67e908..4b7653e 100644 --- a/packages/connectivity/example/lib/main.dart +++ b/packages/connectivity/example/lib/main.dart
@@ -71,10 +71,10 @@ // message was in flight, we want to discard the reply rather than calling // setState to update our non-existent appearance. if (!mounted) { - return; + return Future.value(null); } - _updateConnectionStatus(result); + return _updateConnectionStatus(result); } @override
diff --git a/packages/connectivity/example/test_driver/test/connectivity_e2e_test.dart b/packages/connectivity/example/test_driver/test/connectivity_e2e_test.dart index d4586bd..84b7ae6 100644 --- a/packages/connectivity/example/test_driver/test/connectivity_e2e_test.dart +++ b/packages/connectivity/example/test_driver/test/connectivity_e2e_test.dart
@@ -9,6 +9,6 @@ final FlutterDriver driver = await FlutterDriver.connect(); final String result = await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); + await driver.close(); exit(result == 'pass' ? 0 : 1); }
diff --git a/packages/connectivity/pubspec.yaml b/packages/connectivity/pubspec.yaml index 8dce3c8..c78219a 100644 --- a/packages/connectivity/pubspec.yaml +++ b/packages/connectivity/pubspec.yaml
@@ -3,7 +3,7 @@ mobile/cellular) connectivity on Android and iOS. author: Flutter Team <flutter-dev@googlegroups.com> homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity -version: 0.4.5+6 +version: 0.4.5+7 flutter: plugin: