logout static method

Future<void> logout({
  1. required dynamic onSuccess(
    1. String message
    )?,
  2. required dynamic onError(
    1. CometChatException excep
    )?,
})

Method to log out the user from CometChat

Implementation

static Future<void> logout(
    {required Function(String message)? onSuccess,
    required Function(CometChatException excep)? onError}) async {
  try {
    final result = await channel.invokeMethod('logout');
    if (onSuccess != null) onSuccess(result);
  } on PlatformException catch (p) {
    _errorCallbackHandler(null, p, null, onError);
  } catch (e) {
    _errorCallbackHandler(null, null, e, onError);
  }
}