endCall static method
void
endCall(
- String sessionID, {
- required dynamic onSuccess(
- Call call
- required dynamic onError(
- CometChatException excep
Implementation
static void endCall(String sessionID, {
required Function(Call call)? onSuccess,
required Function(CometChatException excep) onError
}) async {
try {
if(sessionID.isEmpty){
onError(CometChatException("Error", "Session ID is null", "Session ID is null"));
}else{
var result = await channel.invokeMethod('endCall', {
"sessionID": sessionID
});
if(onSuccess != null) onSuccess(Call.fromMap(result));
}
}on PlatformException catch (exception) {
onError(CometChatException(exception.code, exception.message, exception.details));
} catch (e) {
onError(CometChatException("Error", "Something went wrong", e.toString()));
}
}