title: Flutter: Stack - Offstage - TextFormField - issue with focus
body: <p>I have a Stack of a list of Offstage Widgets.
  Each of these Offstage widgets refers to a MaterialApp to display a Form.
  Each of these forms contains several TextFormFields.</p>
  
  <p>The issue I have is that the first and second Offstage items TextFormFields never get the focus (of course considering a correct offstage: index).</p>
  
  <p>In order to make it work, if I put the first Offstage to the third position (thus on top), everything is working fine.</p>
  
  <p>This most probably comes from the notion of Stack or from the Offstage.</p>
  
  <p>Is there a way to force the equivalent of a "<em>z-index</em>"?
  I also tried to use the IndexedStack but the result is identical.</p>
  
  <p>Should I use something else but the Offstage?</p>
  
  <p>Many thanks for your help.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Widget build(BuildContext context) {
      return new Scaffold(
        backgroundColor: Color(0xF4FFFFFF),
        bottomNavigationBar: new Theme(
          data: Theme.of(context).copyWith(
                canvasColor: Colors.amber[700],
                primaryColor: Colors.white,
                textTheme: Theme
                    .of(context)
                    .textTheme
                    .copyWith(caption: new TextStyle(color: Colors.grey[800])),
              ),
          child: new BottomNavigationBar(
              iconSize: 8.0,
              currentIndex: index,
              onTap: (int index) {
                setState(() {
                  this.index = index;
                });
              },
               type: BottomNavigationBarType.fixed,
              items: &lt;BottomNavigationBarItem&gt;[
                  new BottomNavigationBarItem(
                    title: new Text('Sign In',
                        style: new TextStyle(fontSize: 20.0)),
                    icon: new Container(height: 8.0),
                  ),
                  new BottomNavigationBarItem(
                    title: new Text('Register',
                        style: new TextStyle(fontSize: 20.0)),
                    icon: new Text('No account yet',
                        style: new TextStyle(fontSize: 10.0)),
                  ),
                  new BottomNavigationBarItem(
                    title: new Text('lost password',
                        style: new TextStyle(fontSize: 12.0)),
                    icon: new Container(height: 8.0),
                  ),
                ]),
        ),
        body: new SafeArea(
          top: false,
          bottom: false,
          child: new Stack(children: &lt;Widget&gt;[
            new Offstage(
                offstage: index != 0,
                child: new MaterialApp(
                  home: new LoginForm(),
                  debugShowCheckedModeBanner: false,
                )),
            new Offstage(
              offstage: index != 1,
              child: new MaterialApp(
                home: new RegisterForm(),
                debugShowCheckedModeBanner: false,
              ),
            ),
            new Offstage(
              offstage: index != 2,
              child: new MaterialApp(
                home: new LostPasswordForm(),
                debugShowCheckedModeBanner: false,
              ),
            ),
          ]),
        ),
      );
    }
  </code></pre>