mirrored_repositories/news_app/lib/core/network
import 'package:dio/dio.dart';
import 'package:news_app/core/network/remote/api_keys.dart';

class DioHelper {
  static late Dio dio;

  static init() {
    dio = Dio(
      BaseOptions(baseUrl: ApiKeys.base_url, receiveDataWhenStatusError: true),
    );
  }

  static Future<Response> getData({
    required String url,
    Map<String, dynamic>? query,
  }) async {
    return await dio.get(
      url,
      queryParameters: query,
    );
  }
}
