title: How to avoid passing analytics down widget tree?
body: <p>I want track tab change in Flutter app with firebase analytics. In example app they are just pass FirebaseAnalyticsObserver down widget tree:</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    static FirebaseAnalytics analytics = FirebaseAnalytics();
    static FirebaseAnalyticsObserver observer =
        FirebaseAnalyticsObserver(analytics: analytics);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Firebase Analytics Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        navigatorObservers: &lt;NavigatorObserver&gt;[observer],
        home: MyHomePage(
          title: 'Firebase Analytics Demo',
          analytics: analytics,
          observer: observer,
        ),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title, this.analytics, this.observer})
        : super(key: key);
  
    final String title;
    final FirebaseAnalytics analytics;
    final FirebaseAnalyticsObserver observer;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState(analytics, observer);
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    _MyHomePageState(this.analytics, this.observer);
  
    final FirebaseAnalyticsObserver observer;
    final FirebaseAnalytics analytics;
  </code></pre>
  
  <p>But problem is my tab page is far down widget tree. So it is hard to pass all the way down.</p>
  
  <p>How I can initialise FirebaseAnalytics observer to track normal screen route but also provide it to tab page?</p>
  
  <p>I am use Provider and ChangeNotifier. So maybe I can just initialise in a service and then provide this down? For example</p>
  
  <pre><code>class Analytic extends ChangeNotifier {
  
  static FirebaseAnalyticsObserver observer =
  FirebaseAnalyticsObserver(analytics: analytics);
  }
  </code></pre>