logout static method
Logs out the user Deletes the session from the Appwrite server Deletes the session from local storage
Implementation
static Future<Map<String, dynamic>> logout() async {
try {
Account account = Account(_client);
await account.deleteSession(sessionId: 'current');
return {
'error': false,
'type': "success",
'message': "User Logged out success",
'code': "200",
};
// }
} on AppwriteException catch (e) {
return {
'error': true,
'type': e.type,
'message': e.message,
'code': e.code,
};
}
}