logout method
Implementation
@override
Future logout(String email) async {
final pref = await SharedPreferences.getInstance();
try {
final response = await http.get(
Uri.parse('${ApiConfig.baseUrl}/logout'),
headers: ApiConfig.headers,
);
final responseData = json.decode(response.body);
if (pref.containsKey('cookie')) {
await pref.clear();
}
return responseData;
} catch (e) {
throw ApiException('Error logging out: ${e.toString()}');
}
}