title: How to specify type annotations for functions in Dart
body: <p>I can't seem to figure out why I keep getting <code>Specify type annotations. dart(always_specify_types)</code> warning under <code>PageRouteBuilder</code> in this function here.
  I just started using Flutter/Dart and I'm really liking it! </p>
  
  <p>I've tried converting it into a variable and annotating it as a <code>Route</code> but that still did not work out.  </p>
  
  <p>Here is the code. Note that it's <code>PageRouteBuilder</code> that's giving me the type annotation warning.</p>
  
  <pre><code>Navigator.of(context).push(
    PageRouteBuilder(
      pageBuilder: (BuildContext context, _, __) {
        return DashboardPage();
      },
      transitionsBuilder: (_, Animation&lt;double&gt; animation, __, Widget child) {
        return FadeTransition(
          opacity: animation,
          child: child,
        );
      },
    ),
  );
  </code></pre>