leaveGroup static method
Future<void>
leaveGroup(
- String guid, {
- required dynamic onSuccess(
- String returnResponse
- required dynamic onError(
- CometChatException excep
In order to stop receiving updates and messages for any particular joined group.
Owner cannot leave the group , transfer the ownership before leaving the group
guid
A unique identifier for a group that logged in user wants to leave.
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<void> leaveGroup(String guid,
{required Function(String returnResponse)? onSuccess,
required Function(CometChatException excep)? onError}) async {
try {
var result = await channel.invokeMethod('leaveGroup', {
'guid': guid,
});
if (onSuccess != null) onSuccess(result);
return result;
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}