scanItemsByAR method

  1. @override
Future<Either<Failure, Success>> scanItemsByAR(
  1. XFile image, {
  2. String? email,
})
override

Implementation

@override
Future<Either<Failure, Success>> scanItemsByAR(XFile image,
    {String? email}) async {
  var result = await scanRepo.processImageAR(image, email: email);

  var rightResult = result.fold((l) => null, (r) => r);
  if (result.isRight()) {
    return Right(ObjectDetectedSuccess(rightResult!, getDefaultUserId()));
  } else {
    return Left(ItemNotDetectedFailure());
  }
}