logout static method
Future<void>
logout({
- required dynamic onSuccess(
- String message
- required dynamic onError(
- 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 (platformException) {
if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
} catch (e) {
if(onError != null) onError(CometChatException("Error", e.toString(), e.toString()));
}
}