title: Instance member 'setCurrentScreen' can't be accessed using static access
body: <p>I am trying to add Firebase Analytics to my flutter app to display different screen names on the dashboard. I used a method that I found here on stackoverflow in this link:
  <a href="https://stackoverflow.com/questions/55830575/how-do-i-track-flutter-screens-in-firebase-analytics">How do I track Flutter screens in Firebase analytics?</a></p>
  <p>I added this code in a separate file:</p>
  <pre><code>import 'package:firebase_analytics/firebase_analytics.dart';
  import 'package:flutter/widgets.dart';
  
  // A Navigator observer that notifies RouteAwares of changes to state of their Route
  final routeObserver = RouteObserver&lt;PageRoute&gt;();
  
  mixin RouteAwareAnalytics&lt;T extends StatefulWidget&gt; on State&lt;T&gt;
      implements RouteAware {
    AnalyticsRoute get route;
    @override
    void didChangeDependencies() {
      routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute&lt;dynamic&gt;);
      super.didChangeDependencies();
    }
  
    @override
    void dispose() {
      routeObserver.unsubscribe(this);
      super.dispose();
    }
  
    @override
    void didPop() {}
  
    @override
    void didPopNext() {
      // Called when the top route has been popped off,
      // and the current route shows up.
      _setCurrentScreen(route);
    }
  
    @override
    void didPush() {
      // Called when the current route has been pushed.
      _setCurrentScreen(route);
    }
  
    @override
    void didPushNext() {}
  
    Future&lt;void&gt; _setCurrentScreen(AnalyticsRoute analyticsRoute) {
      print('Setting current screen to $analyticsRoute');
      return FirebaseAnalytics.**setCurrentScreen**(
        screenName: screenName(analyticsRoute),
        screenClassOverride: screenClass(analyticsRoute),
      );
    }
  }
  
  enum AnalyticsRoute { screenName }
  
  String screenClass(AnalyticsRoute route) {
    switch (route) {
      case AnalyticsRoute.screenName:
        return 'screenName';
    }
    throw ArgumentError.notNull('route');
  }
  
  String screenName(AnalyticsRoute route) {
    switch (route) {
      case AnalyticsRoute.screenName:
        return '/screenName';
    }
    throw ArgumentError.notNull('route');
  }
  </code></pre>
  <p>I then added the route observer in the screen that I want to track.
  The setCurrentScreen method is not working well and the app is not building. Any suggestions on what I could do to build it.</p>