changeCamera method
Switches the camera to the specified CameraType.
cameraType
: The camera to switch to, either CameraType.FRONT or CameraType.BACK.
Throws an Exception if the camera switch fails.
Implementation
@override
Future<void> changeCamera(CameraType cameraType) async {
try {
await methodChannel.invokeMethod<void>('changeCamera', <String, dynamic>{
'type': cameraType.index.toString(),
});
} catch (e) {
throw Exception("Unable to change the camera [Change Camera]");
}
}