getGroup static method
Future<Group?>
getGroup(
- String guid, {
- required dynamic onSuccess(
- Group retGrou
- required dynamic onError(
- CometChatException excep
Retrieve information for a specific group
guid
guid of group
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<Group?> getGroup(String guid, {required Function(Group retGrou)? onSuccess, required Function(CometChatException excep)? onError}) async {
try {
final result = await channel.invokeMethod('getGroup', {
'guid': guid,
});
final Group res = Group.fromMap(result);
if(onSuccess != null) onSuccess(res);
return res;
} 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()));
}
return null;
}