getUserById method
Implementation
@override
Future<Either<Failure, Map<String, dynamic>>> getUserById(int id) async {
try{
final response = await _dioClient.get('/users/$id');
return Right(Map<String, dynamic>.from(response.data));
}catch(e, stackTrace){
if(e is Failure){
return left(e);
}
return left(
Failure(
title: 'Error de gateway',
code: 'gateway_error',
description: e.toString(),
stackTrace: stackTrace.toString(),
type: FailureSeverity.blocking
)
);
}
}