Skip to content

Commit

Permalink
🚀 Make camera switching available.
Browse files Browse the repository at this point in the history
Resolves #5 .
  • Loading branch information
AlexV525 committed Jul 23, 2020
1 parent 89bb14e commit 751bbc0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/widget/camera_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class CameraPickerState extends State<CameraPicker> {
/// Initialize cameras instances.
/// 初始化相机实例
Future<void> initCameras({CameraDescription cameraDescription}) async {
cameraController?.dispose();
await cameraController?.dispose();

/// When it's null, which means this is the first time initializing the cameras.
/// So cameras should fetch.
Expand Down Expand Up @@ -516,10 +516,11 @@ class CameraPickerState extends State<CameraPicker> {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Row(
children: const <Widget>[
Spacer(),
children: <Widget>[
const Spacer(),
// TODO(Alex): There's an issue tracking NPE of the camera plugin, so switching is temporary disabled .
// if ((cameras?.length ?? 0) > 1) switchCamerasButton,
if ((cameras?.length ?? 0) > 1)
switchCamerasButton,
],
),
);
Expand Down

0 comments on commit 751bbc0

Please sign in to comment.