title: Widget's didUpdateWidget method called when screen rotates with MaterialApp routes
body: <p>When I use <code>routes</code> in <code>MaterialApp</code> the child widget's (<code>MyHomePage</code>) <code>didUpdateWidget</code> is called whenever I rotate the screen/open the keyboard etc.</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        routes: {
          '/': (_) =&gt; MyHomePage(title: 'Flutter Demo Home Page'),
        },
        initialRoute: '/',
      );
    }
  }
  </code></pre>
  
  <p>On the other hand, when I use the <code>home</code> parameter, <code>didUpdateWidget</code> is not called when I rotate the screen/open the keyboard.</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        home: MyHomePage(title: 'Flutter Demo Home Page'),
      );
    }
  }
  </code></pre>
  
  <p>The issue I have is that I am using the <a href="https://github.com/filiph/state_experiments/blob/master/shared/lib/src/bloc_complex/product_grid/product_square.dart" rel="noreferrer">Bloc pattern sample</a> as a guide so my Bloc is disposed and recreated whenever the <code>didUpdateWidget</code> is called. This means I lose all my app's state that is in the Bloc, e.g. what is selected.</p>
  
  <pre><code>@override
  void didUpdateWidget(ProductSquare oldWidget) {
      super.didUpdateWidget(oldWidget);
      _disposeBloc();
      _createBloc();
  }
  </code></pre>
  
  <p>Why is there a difference is behavior between using <code>routes</code> and <code>home</code>? How can I make <code>routes</code> behave like <code>home</code> and not call <code>didUpdateWidget</code> when the screen is rotated so the bloc is not unnecessarily recreated?</p>
  
  <p>Full app sample without Bloc that rebuilds whenever I rotate the screen.</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        routes: {
          '/': (_) =&gt; MyHomePage(title: 'Flutter Demo Home Page'),
        },
        initialRoute: '/',
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    int _counter = 0;
  
    void _incrementCounter() {
      setState(() {
        _counter++;
      });
    }
  
    @override
    void didUpdateWidget(MyHomePage oldWidget) {
      super.didUpdateWidget(oldWidget);
  
      print('didUpdateWidget');
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.display1,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
      );
    }
  }
  </code></pre>