getGroup static method

Future<Group?> getGroup(
  1. String guid, {
  2. required dynamic onSuccess(
    1. Group retGrou
    )?,
  3. required dynamic onError(
    1. 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 (p) {
    _errorCallbackHandler(null, p, null, onError);
  } catch (e) {
    _errorCallbackHandler(null, null, e, onError);
  }
  return null;
}