getRequest method

Future<Either<Failure, Response>> getRequest(
  1. Dio dio,
  2. String url
)

Implementation

Future<Either<Failure, Response>> getRequest(Dio dio, String url) async {
  try {
    var response =
        await dio.get(url, options: Options(contentType: "application/json"));
    return Right(response);
  } catch (e) {
    return Left(HelperGetRequestFailure());
  }
}