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