Skip to content

Commit 52a1f7c

Browse files
panmariEgor
authored andcommitted
Fix bug in example (flutter#2801)
By ensuring that flutter widget bindings are initialized. The current version fails on startup.
1 parent bfce5a7 commit 52a1f7c

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

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.8+3
2+
3+
* Fix bug in usage example in README.md
4+
15
## 0.5.8+2
26

37
* Post-v2 embedding cleanups.

packages/camera/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import 'package:camera/camera.dart';
5353
List<CameraDescription> cameras;
5454
5555
Future<void> main() async {
56+
WidgetsFlutterBinding.ensureInitialized();
5657
cameras = await availableCameras();
5758
runApp(CameraApp());
5859
}

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.8+2
5+
version: 0.5.8+3
66

77
homepage: https://github.com/flutter/plugins/tree/master/packages/camera
88

0 commit comments

Comments
 (0)