getCachedUser method
Implementation
@override
Future<UserModel?> getCachedUser() async {
try {
final userJson = _prefs.getString(_userKey);
if (userJson != null) {
final userMap = jsonDecode(userJson) as Map<String, dynamic>;
return UserModel.fromJson(userMap);
}
return null;
} catch (e) {
throw const CacheException('Failed to get cached user data');
}
}