setFlashMode method Null safety

Future<void> setFlashMode(
  1. FlashMode mode
)

Sets the flash mode for taking pictures.

Implementation

Future<void> setFlashMode(FlashMode mode) async {
  try {
    await CameraPlatform.instance.setFlashMode(_cameraId, mode);
    value = value.copyWith(flashMode: mode);
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}