getRequest<T> method

Future<Either<Failure, T>> getRequest<T>(
  1. String endpoint, {
  2. Map<String, dynamic>? params,
})

Implementation

Future<Either<Failure, T>> getRequest<T>(
  String endpoint, {
  Map<String, dynamic>? params,
}) async {
  try {
    final response = await _dio.get(endpoint, queryParameters: params);
    return Right(response.data);
  } on DioException catch (e) {
    return Left(_handleDioError(e));
  }
}