title: Pages on Navigator stack rebuild when a new page is pushed in Flutter
body: <p>I'm developing a Flutter app which prompts a form asking for some personal info.</p>
  
  <p><strong>The problem is that the page is being rebuilt every time something happens</strong>, like when the screen orientation changes or when a text field gets the focus (<em>the keyboard appears and disappears right away, preventing the user from typing anything</em>).</p>
  
  <p>Obviously something is triggering unwanted rebuilds, but I couldn't find out what and where.</p>
  
  <p><strong>When I plug this page as the homepage, everything works fine.
  The issue happens when I plug the page at its intended position, after an animation is displayed on a splash screen, so I guess it has something to do with my problem.</strong></p>
  
  <p>Main class :</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import './view/SplashScreen.dart';
  
  void main() =&gt; runApp(new MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Flutter Demo',
        theme: new ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: new SplashScreen(),
      );
    }
  }
  </code></pre>
  
  <p>Splash screen :</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'dart:async';
  import './UserLoader.dart';
  
  class SplashScreen extends StatefulWidget {
    @override
    _SplashScreenState createState() =&gt; new _SplashScreenState();
  }
  
  class _SplashScreenState extends State&lt;SplashScreen&gt;
      with SingleTickerProviderStateMixin {
    AnimationController _iconAnimationController;
    CurvedAnimation _iconAnimation;
  
    @override
    void initState() {
      super.initState();
  
      _iconAnimationController = new AnimationController(
          vsync: this, duration: new Duration(milliseconds: 2000));
  
      _iconAnimation = new CurvedAnimation(
          parent: _iconAnimationController, curve: Curves.easeIn);
      _iconAnimation.addListener(() =&gt; this.setState(() {}));
  
      _iconAnimationController.forward();
  
      startTimeout();
    }
  
    @override
    Widget build(BuildContext context) {
      return new Material(
        color: Colors.white,
        child: new InkWell(
          child: new Center(
            child: new Container(
              width: 275.0,
              height: 275.0,
              decoration: new BoxDecoration(
                image: new DecorationImage(
                    colorFilter: new ColorFilter.mode(
                        Colors.white.withOpacity(_iconAnimation.value),
                        BlendMode.dstATop),
                    image: new AssetImage("images/logo.png")),
              ),
            ),
          ),
        ),
      );
    }
  
    void handleTimeout() {
      Navigator.of(context).pushReplacement(new MaterialPageRoute(
          builder: (BuildContext context) =&gt; new UserLoader()));
    }
  
    startTimeout() async {
      var duration = const Duration(seconds: 3);
      return new Timer(duration, handleTimeout);
    }
  }
  </code></pre>
  
  <p>Faulty page :</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  class UserLoader extends StatefulWidget {
    @override
    _UserLoaderState createState() =&gt; new _UserLoaderState();
  }
  
  class _UserLoaderState extends State&lt;UserLoader&gt; {
    @override
    Widget build(BuildContext context) {
      final _formKey = new GlobalKey&lt;FormState&gt;();
      final _emailController = new TextEditingController();
  
      return new Scaffold(
          appBar: new AppBar(
            title: new Text("Informations"),
            actions: &lt;Widget&gt;[
              new IconButton(
                  icon: const Icon(Icons.save),
                  onPressed: () {
                    // unrelated stuff happens here
                  })
            ],
          ),
          body: new Center(
            child: new SingleChildScrollView(
                child: new Form(
                    key: _formKey,
                    child: new Column(children: &lt;Widget&gt;[
                      new ListTile(
                        leading: const Icon(Icons.email),
                        title: new TextFormField(
                          decoration: new InputDecoration(
                            hintText: "Email",
                          ),
                          keyboardType: TextInputType.emailAddress,
                          controller: _emailController,
                          validator: _validateEmail,
                        ),
                      ),
                    ]))),
          ));
      }}
  </code></pre>
  
  <p>Can anybody help me find out why the page is continuously rebuilding itself ?</p>