switchCamera static method

void switchCamera({
  1. required dynamic onSuccess(
    1. String onSuccess
    ),
  2. required dynamic onError(
    1. CometChatCallsException excep
    ),
})

Switches the camera.

  • onSuccess: A callback function that is called when the camera is successfully switched.
  • onError: A callback function that is called when an error occurs while switching the camera.

Example: CometChatCalls.switchCamera( onSuccess: (message) { // The camera was successfully switched. }, onError: (error) { // An error occurred while switching the camera. }, );

Implementation

static void switchCamera({
  required Function(String onSuccess) onSuccess,
  required Function(CometChatCallsException excep) onError
}) {
  CometchatcallsPluginPlatform.instance.switchCamera(onSuccess, onError);
}