deleteGroup static method
Future<void>
deleteGroup(
- String guid, {
- required dynamic onSuccess(
- String message
- required dynamic onError(
- CometChatException excep
In order to delete a group.
The user must be an Admin of the group they are trying to delete.
guid
A unique identifier for a group that logged in user wants to delete.
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<void> deleteGroup(String guid, {required Function(String message)? onSuccess, required Function(CometChatException excep)? onError}) async {
try {
var result = await channel.invokeMethod('deleteGroup', {
'guid': guid,
});
if(onSuccess != null) onSuccess(result);
} on PlatformException catch (platformException) {
if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
} catch (e) {
debugPrint("Error: $e");
if(onError != null) onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
}