Commit f6d50d2 1 parent cbd4363 commit f6d50d2 Copy full SHA for f6d50d2
File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1234,12 +1234,16 @@ class CameraState extends EWidgetState<Camera> with WidgetsBindingObserver {
1234
1234
itemBuilder: (context, index) {
1235
1235
return IconButton (
1236
1236
onPressed: () {
1237
- final page = (index + 1 ) % flashIcons.length;
1238
- _flashPageController.animateToPage (page,
1239
- duration: const Duration (milliseconds: 400 ),
1240
- curve: Curves .ease);
1241
- widget._controller.cameraController
1242
- ? .setFlashMode (flashModes.elementAt (page));
1237
+ try {
1238
+ final page = (index + 1 ) % flashIcons.length;
1239
+ _flashPageController.animateToPage (page,
1240
+ duration: const Duration (milliseconds: 400 ),
1241
+ curve: Curves .ease);
1242
+ widget._controller.cameraController
1243
+ ? .setFlashMode (flashModes.elementAt (page));
1244
+ } catch (e){
1245
+ debugPrint ("CameraException: ${e }" );
1246
+ }
1243
1247
},
1244
1248
icon: Icon (flashIcons.elementAt (index)),
1245
1249
color: Colors .white);
You can’t perform that action at this time.
0 commit comments