switchCamera method
If deviceId
is null, it'll switch to the next available camera. Otherwise, it will switch to the camera with the deviceId
Return true if the switch to the next camera was successful. Otherwise, this function returns false.
Implementation
@override
Future<bool> switchCamera(String? deviceId) async {
var params = <String, dynamic>{};
params.putIfAbsent("deviceId", () => deviceId);
return await methodChannel
.invokeMethod<bool>('switchCamera', params)
.then<bool>((bool? value) => value ?? false);
}