mirrored_repositories/CompleteNewsApp/lib/shared/network
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';

class DioHelper {
  static Dio dio;

  static void init() {
    dio = Dio(
      BaseOptions(
        baseUrl: 'https://newsapi.org/',
        receiveDataWhenStatusError: true,
      ),
    );
  }

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