title: Global configuration (interceptor) for dio in Flutter
body: <p>First time with Flutter. I'm using dio to send HTTP requests, and I have to add a header to all requests, which I do with an interceptor, like this:</p>
  
  <pre><code>Dio dio = new Dio();
  dio.interceptors.add(InterceptorsWrapper(
      onRequest:(RequestOptions options) async {
        options.headers["X-Requested-With"] = "XMLHttpRequest";
      })
  );
  </code></pre>
  
  <p>It works in main.dart, but if I want to import another class like MyHomePage.dart and do HTTP requests there, I'd have to redefine the interceptor in that class too.</p>
  
  <p>How can I implement this interceptor for my whole application without adding it in every .dart file?</p>