setFlashMode method

  1. @override
Future<void> setFlashMode(
  1. int cameraId,
  2. FlashMode mode
)

Sets the flash mode for the selected camera. On Web FlashMode.auto corresponds to FlashMode.always.

Implementation

@override
Future<void> setFlashMode(int cameraId, FlashMode mode) async {
  try {
    getCamera(cameraId).setFlashMode(mode);
  } on html.DomException catch (e) {
    throw PlatformException(code: e.name, message: e.message);
  } on CameraWebException catch (e) {
    _addCameraErrorEvent(e);
    throw PlatformException(code: e.code.toString(), message: e.description);
  }
}