Skip to content

Commit 948744e

Browse files
author
Michael Klimushyn
authored
[camera] Fix unawaited future errors (flutter#2312)
There's a over a dozen API surfaces that are undocumented still. This just fixes one of the new pedantic lints.
1 parent 2d15096 commit 948744e

7 files changed

Lines changed: 10 additions & 5 deletions

File tree

packages/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.7
2+
3+
* Fix unawaited futures.
4+
15
## 0.5.6+4
26

37
* Android: Use CameraDevice.TEMPLATE_RECORD to improve image streaming.

packages/camera/analysis_options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ include: ../../analysis_options.yaml
88
analyzer:
99
errors:
1010
public_member_api_docs: ignore
11-
unawaited_futures: ignore

packages/camera/example/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// ignore_for_file: public_member_api_docs
6+
57
import 'dart:async';
68
import 'dart:io';
79

packages/camera/example/test_driver/camera_e2e.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void main() {
231231
sleep(const Duration(milliseconds: 500));
232232

233233
await controller.stopImageStream();
234-
controller.dispose();
234+
await controller.dispose();
235235
},
236236
skip: !Platform.isAndroid,
237237
);

packages/camera/example/test_driver/camera_e2e_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Future<void> main() async {
3535
final FlutterDriver driver = await FlutterDriver.connect();
3636
final String result =
3737
await driver.requestData(null, timeout: const Duration(minutes: 1));
38-
driver.close();
38+
await driver.close();
3939
print('Test finished. Revoking camera permissions...');
4040
Process.runSync('adb', <String>[
4141
'shell',

packages/camera/lib/camera.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ class CameraController extends ValueNotifier<CameraValue> {
445445
throw CameraException(e.code, e.message);
446446
}
447447

448-
_imageStreamSubscription.cancel();
448+
await _imageStreamSubscription.cancel();
449449
_imageStreamSubscription = null;
450450
}
451451

packages/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.5.6+3
5+
version: 0.5.7
66

77
authors:
88
- Flutter Team <[email protected]>

0 commit comments

Comments
 (0)