onFlashLight method
Flash Light
This Flash Light
Throws a CameraException if the capture fails.
Implementation
Future<void> onFlashLight() async {
if (!value.isInitialized! || _isDisposed) {
throw CameraException(
'Uninitialized CameraController',
'startVideoStreaming was called on uninitialized CameraController',
);
}
if (!value.isStreamingVideoRtmp!) {
throw CameraException(
'No video is recording',
'resumeVideoStreaming was called when no video is streaming.',
);
}
if(!Platform.isAndroid){
throw CameraException(
'Currently only supports Android platform',
'Please use on Android platform',
);
}
try {
await _channel
.invokeMethod<void>('onFlashLight', <String, dynamic>{
});
} on PlatformException catch (e) {
throw CameraException(e.code, e.message);
}
}