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 @@ -1240,12 +1240,16 @@ class CameraState extends EWidgetState<Camera> with WidgetsBindingObserver {
1240
1240
itemBuilder: (context, index) {
1241
1241
return IconButton (
1242
1242
onPressed: () {
1243
- final page = (index + 1 ) % flashIcons.length;
1244
- _flashPageController.animateToPage (page,
1245
- duration: const Duration (milliseconds: 400 ),
1246
- curve: Curves .ease);
1247
- widget._controller.cameraController
1248
- ? .setFlashMode (flashModes.elementAt (page));
1243
+ try {
1244
+ final page = (index + 1 ) % flashIcons.length;
1245
+ _flashPageController.animateToPage (page,
1246
+ duration: const Duration (milliseconds: 400 ),
1247
+ curve: Curves .ease);
1248
+ widget._controller.cameraController
1249
+ ? .setFlashMode (flashModes.elementAt (page));
1250
+ } catch (e){
1251
+ debugPrint ("CameraException: ${e }" );
1252
+ }
1249
1253
},
1250
1254
icon: Icon (flashIcons.elementAt (index)),
1251
1255
color: Colors .white);
You can’t perform that action at this time.
0 commit comments