addUser method
Implementation
@override
Future<Either<Failure, User>> addUser(User user) async {
final result = await _gateway.addUser(user.toJson());
return result.fold(
Left.new,
(json){
try{
final user = User.fromJson(json);
return Right(user);
}catch(e, stackTrace){
return Left(
Failure(
title: 'Error en el UserRepositoryImpl',
code: 'mapping_error',
description: "Error al mapear el usuario despues de agregar el usuario",
stackTrace: stackTrace.toString(),
type: FailureSeverity.warning
)
);
}
}
);
}