title: Animation for named routes
body: <p>In Flutter we can customize the view-change animation by extending <code>PageRoute</code> (or by using a class which extends that).</p>
  
  <p>For instance, I'm changing the animation to "slide" in my <code>MaterialApplication</code> by using the <code>CupertinoPageRoute</code> that way:</p>
  
  <pre><code>Navigator.of(context).pushReplacement(
    CupertinoPageRoute(builder: (context) =&gt; Calendar()),
  );
  </code></pre>
  
  <p>Now I want to change that by using named views defined in the <code>main.dart</code> file:</p>
  
  <pre><code>return MaterialApp(
    title: 'Demo',
    theme: myTheme, // =&gt; Theme.of(context).copyWith(...)
    initialRoute: '/',
    routes: {
      '/': (context) =&gt; Login(),
      '/calendar': (context) =&gt; Calendar(),
    }
  );
  </code></pre>
  
  <p>This way I can just call</p>
  
  <pre><code>Navigator.of(context).pushReplacementNamed('/calendar');
  </code></pre>
  
  <p>Which is IMO clearer and view-agnostic.</p>
  
  <p>The issue with this approach is that I can't define a <code>PageRoute</code>, so I can't customize the view-change animation.</p>
  
  <p>Is there a way to do that?</p>