<h2 dir="auto">Overview</h2>
<p dir="auto">This is implementation of BottomBar with multiple Navigation stack to archive multi-workspace UX, as explained in <a href="https://stackoverflow.com/questions/46483949/how-to-get-current-route-path-in-flutter" rel="nofollow">here</a>.</p>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Run this flutter app</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    import 'package:flutter/material.dart';
    
    void main() {
      runApp(new MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return new MaterialApp(
          home: new MyHomePage(),
        );
      }
    }
    
    class SecurePage extends StatelessWidget {
      final int index;
    
      SecurePage(this.index);
    
      Widget build(BuildContext context) {
        return new Column(
          children: &lt;Widget&gt;[
            new AppBar(
              title: new Text('Secure'),
            ),
            new Text('No $index'),
            new Padding(
              padding: const EdgeInsets.symmetric(horizontal: 16.0),
              child: new TextField(
                autofocus: index % 2 == 1,
                decoration: const InputDecoration(
                  hintText: 'Search',
                ),
              ),
            ),
            new IconButton(
              icon: new Icon(Icons.verified_user),
              onPressed: () {
                Navigator.of(context).push(
                  new MaterialPageRoute(
                    builder: (BuildContext context) {
                      return new VerifiedPage(index + 1);
                    },
                  ),
                );
              },
            ),
          ],
        );
      }
    }
    
    class VerifiedPage extends StatelessWidget {
      final int index;
    
      VerifiedPage(this.index);
    
      Widget build(BuildContext context) {
        return new Column(
          children: &lt;Widget&gt;[
            new AppBar(
              title: new Text('Verity'),
            ),
            new Text('No $index'),
            new Padding(
              padding: const EdgeInsets.symmetric(horizontal: 16.0),
              child: new TextField(
                autofocus: index % 2 == 1,
                decoration: const InputDecoration(
                  hintText: 'Search',
                ),
              ),
            ),
            new IconButton(
              icon: new Icon(Icons.security),
              onPressed: () {
                Navigator.of(context).push(
                  new MaterialPageRoute(
                    builder: (BuildContext context) {
                      return new SecurePage(index + 1);
                    },
                  ),
                );
              },
            ),
          ],
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      @override
      State createState() =&gt; new MyHomePageState();
    }
    
    class MyHomePageState extends State&lt;MyHomePage&gt; {
      int _page = 0;
      List&lt;Widget&gt; initialWidgets = &lt;Widget&gt;[
        new SecurePage(0),
        new VerifiedPage(0),
      ];
    
      Widget build(BuildContext context) {
        return new Scaffold(
          body: new Stack(
            children: new List&lt;Widget&gt;.generate(initialWidgets.length, (int index) {
              return new IgnorePointer(
                ignoring: index != _page,
                child: new Opacity(
                  opacity: _page == index ? 1.0 : 0.0,
                  child: new Navigator(
                    onGenerateRoute: (RouteSettings settings) {
                      return new MaterialPageRoute(
                        builder: (_) =&gt; initialWidgets[index],
                      );
                    },
                  ),
                ),
              );
            }),
          ),
          bottomNavigationBar: new BottomNavigationBar(
            currentIndex: _page,
            onTap: (int index) {
              setState(() {
                _page = index;
              });
            },
            items: &lt;BottomNavigationBarItem&gt;[
              new BottomNavigationBarItem(
                icon: new Icon(Icons.security),
                title: new Text('Secure'),
              ),
              new BottomNavigationBarItem(
                icon: new Icon(Icons.verified_user),
                title: new Text('Verified'),
              ),
            ],
          ),
        );
      }
    }"><pre class="notranslate">    import <span class="pl-s">'package:flutter/material.dart'</span>;
    
    <span class="pl-k">void</span> <span class="pl-en">main</span>() {
      <span class="pl-en">runApp</span>(<span class="pl-k">new</span> <span class="pl-c1">MyApp</span>());
    }
    
    <span class="pl-k">class</span> <span class="pl-c1">MyApp</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
      <span class="pl-k">@override</span>
      <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialApp</span>(
          home<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">MyHomePage</span>(),
        );
      }
    }
    
    <span class="pl-k">class</span> <span class="pl-c1">SecurePage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
      <span class="pl-k">final</span> <span class="pl-c1">int</span> index;
    
      <span class="pl-c1">SecurePage</span>(<span class="pl-c1">this</span>.index);
    
      <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">Column</span>(
          children<span class="pl-k">:</span> <span class="pl-k">&lt;</span><span class="pl-c1">Widget</span><span class="pl-k">&gt;</span>[
            <span class="pl-k">new</span> <span class="pl-c1">AppBar</span>(
              title<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Secure'</span>),
            ),
            <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'No $<span class="pl-v">index</span>'</span>),
            <span class="pl-k">new</span> <span class="pl-c1">Padding</span>(
              padding<span class="pl-k">:</span> <span class="pl-k">const</span> <span class="pl-c1">EdgeInsets</span>.<span class="pl-en">symmetric</span>(horizontal<span class="pl-k">:</span> <span class="pl-c1">16.0</span>),
              child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">TextField</span>(
                autofocus<span class="pl-k">:</span> index <span class="pl-k">%</span> <span class="pl-c1">2</span> <span class="pl-k">==</span> <span class="pl-c1">1</span>,
                decoration<span class="pl-k">:</span> <span class="pl-k">const</span> <span class="pl-c1">InputDecoration</span>(
                  hintText<span class="pl-k">:</span> <span class="pl-s">'Search'</span>,
                ),
              ),
            ),
            <span class="pl-k">new</span> <span class="pl-c1">IconButton</span>(
              icon<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.verified_user),
              onPressed<span class="pl-k">:</span> () {
                <span class="pl-c1">Navigator</span>.<span class="pl-en">of</span>(context).<span class="pl-en">push</span>(
                  <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
                    builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) {
                      <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">VerifiedPage</span>(index <span class="pl-k">+</span> <span class="pl-c1">1</span>);
                    },
                  ),
                );
              },
            ),
          ],
        );
      }
    }
    
    <span class="pl-k">class</span> <span class="pl-c1">VerifiedPage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
      <span class="pl-k">final</span> <span class="pl-c1">int</span> index;
    
      <span class="pl-c1">VerifiedPage</span>(<span class="pl-c1">this</span>.index);
    
      <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">Column</span>(
          children<span class="pl-k">:</span> <span class="pl-k">&lt;</span><span class="pl-c1">Widget</span><span class="pl-k">&gt;</span>[
            <span class="pl-k">new</span> <span class="pl-c1">AppBar</span>(
              title<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Verity'</span>),
            ),
            <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'No $<span class="pl-v">index</span>'</span>),
            <span class="pl-k">new</span> <span class="pl-c1">Padding</span>(
              padding<span class="pl-k">:</span> <span class="pl-k">const</span> <span class="pl-c1">EdgeInsets</span>.<span class="pl-en">symmetric</span>(horizontal<span class="pl-k">:</span> <span class="pl-c1">16.0</span>),
              child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">TextField</span>(
                autofocus<span class="pl-k">:</span> index <span class="pl-k">%</span> <span class="pl-c1">2</span> <span class="pl-k">==</span> <span class="pl-c1">1</span>,
                decoration<span class="pl-k">:</span> <span class="pl-k">const</span> <span class="pl-c1">InputDecoration</span>(
                  hintText<span class="pl-k">:</span> <span class="pl-s">'Search'</span>,
                ),
              ),
            ),
            <span class="pl-k">new</span> <span class="pl-c1">IconButton</span>(
              icon<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.security),
              onPressed<span class="pl-k">:</span> () {
                <span class="pl-c1">Navigator</span>.<span class="pl-en">of</span>(context).<span class="pl-en">push</span>(
                  <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
                    builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) {
                      <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">SecurePage</span>(index <span class="pl-k">+</span> <span class="pl-c1">1</span>);
                    },
                  ),
                );
              },
            ),
          ],
        );
      }
    }
    
    <span class="pl-k">class</span> <span class="pl-c1">MyHomePage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatefulWidget</span> {
      <span class="pl-k">@override</span>
      <span class="pl-c1">State</span> <span class="pl-en">createState</span>() <span class="pl-k">=&gt;</span> <span class="pl-k">new</span> <span class="pl-c1">MyHomePageState</span>();
    }
    
    <span class="pl-k">class</span> <span class="pl-c1">MyHomePageState</span> <span class="pl-k">extends</span> <span class="pl-c1">State</span>&lt;<span class="pl-c1">MyHomePage</span>&gt; {
      <span class="pl-c1">int</span> _page <span class="pl-k">=</span> <span class="pl-c1">0</span>;
      <span class="pl-c1">List</span>&lt;<span class="pl-c1">Widget</span>&gt; initialWidgets <span class="pl-k">=</span> <span class="pl-k">&lt;</span><span class="pl-c1">Widget</span><span class="pl-k">&gt;</span>[
        <span class="pl-k">new</span> <span class="pl-c1">SecurePage</span>(<span class="pl-c1">0</span>),
        <span class="pl-k">new</span> <span class="pl-c1">VerifiedPage</span>(<span class="pl-c1">0</span>),
      ];
    
      <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">Scaffold</span>(
          body<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Stack</span>(
            children<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">List</span>&lt;<span class="pl-c1">Widget</span>&gt;.<span class="pl-en">generate</span>(initialWidgets.length, (<span class="pl-c1">int</span> index) {
              <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">IgnorePointer</span>(
                ignoring<span class="pl-k">:</span> index <span class="pl-k">!=</span> _page,
                child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Opacity</span>(
                  opacity<span class="pl-k">:</span> _page <span class="pl-k">==</span> index <span class="pl-k">?</span> <span class="pl-c1">1.0</span> <span class="pl-k">:</span> <span class="pl-c1">0.0</span>,
                  child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Navigator</span>(
                    onGenerateRoute<span class="pl-k">:</span> (<span class="pl-c1">RouteSettings</span> settings) {
                      <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
                        builder<span class="pl-k">:</span> (_) <span class="pl-k">=&gt;</span> initialWidgets[index],
                      );
                    },
                  ),
                ),
              );
            }),
          ),
          bottomNavigationBar<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">BottomNavigationBar</span>(
            currentIndex<span class="pl-k">:</span> _page,
            onTap<span class="pl-k">:</span> (<span class="pl-c1">int</span> index) {
              <span class="pl-en">setState</span>(() {
                _page <span class="pl-k">=</span> index;
              });
            },
            items<span class="pl-k">:</span> <span class="pl-k">&lt;</span><span class="pl-c1">BottomNavigationBarItem</span><span class="pl-k">&gt;</span>[
              <span class="pl-k">new</span> <span class="pl-c1">BottomNavigationBarItem</span>(
                icon<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.security),
                title<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Secure'</span>),
              ),
              <span class="pl-k">new</span> <span class="pl-c1">BottomNavigationBarItem</span>(
                icon<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.verified_user),
                title<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Verified'</span>),
              ),
            ],
          ),
        );
      }
    }</pre></div>
<h2 dir="auto">What is wrong</h2>
<p dir="auto">Keyboard is not coming up in the first view ('Secure'), although it received keyboard input. Note, IconButton is working fine.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2137932/31050452-bd4bbbfc-a67c-11e7-8e96-ddb47c996936.gif"><img src="https://user-images.githubusercontent.com/2137932/31050452-bd4bbbfc-a67c-11e7-8e96-ddb47c996936.gif" alt="xvc8eh0st0" data-animated-image="" style="max-width: 100%;"></a></p>
<h2 dir="auto">Expected</h2>
<p dir="auto">TextField should work in both Secure and Verfity pages.</p>
<p dir="auto">Steps To Reproduce</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() =&gt; _HomePageState();
}

class _HomePageState extends State&lt;HomePage&gt; {
  final int _pageCount = 2;
  int _pageIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _body(),
      bottomNavigationBar: _bottomNavigationBar(),
    );
  }

  Widget _body() {
    return Stack(
      children: List&lt;Widget&gt;.generate(_pageCount, (int index) {
        return IgnorePointer(
          ignoring: index != _pageIndex,
          child: Opacity(
            opacity: _pageIndex == index ? 1.0 : 0.0,
            child: Navigator(
              onGenerateRoute: (RouteSettings settings) {
                return new MaterialPageRoute(
                  builder: (_) =&gt; _page(index),
                  settings: settings,
                );
              },
            ),
          ),
        );
      }),
    );
  }

  Widget _page(int index) {
    switch (index) {
      case 0:
        return Page1();
      case 1:
        return Page2();
    }

    throw &quot;Invalid index $index&quot;;
  }

  BottomNavigationBar _bottomNavigationBar() {
    final theme = Theme.of(context);
    return new BottomNavigationBar(
      fixedColor: theme.accentColor,
      currentIndex: _pageIndex,
      items: [
        BottomNavigationBarItem(
          icon: Icon(Icons.list),
          title: Text(&quot;Page 1&quot;),
        ),
        BottomNavigationBarItem(
          icon: Icon(Icons.account_circle),
          title: Text(&quot;Page 2&quot;),
        ),
      ],
      onTap: (int index) {
        setState(() {
          _pageIndex = index;
        });
      },
    );
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-c1">HomePage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatefulWidget</span> {
  <span class="pl-k">@override</span>
  <span class="pl-c1">_HomePageState</span> <span class="pl-en">createState</span>() <span class="pl-k">=&gt;</span> <span class="pl-c1">_HomePageState</span>();
}

<span class="pl-k">class</span> <span class="pl-c1">_HomePageState</span> <span class="pl-k">extends</span> <span class="pl-c1">State</span>&lt;<span class="pl-c1">HomePage</span>&gt; {
  <span class="pl-k">final</span> <span class="pl-c1">int</span> _pageCount <span class="pl-k">=</span> <span class="pl-c1">2</span>;
  <span class="pl-c1">int</span> _pageIndex <span class="pl-k">=</span> <span class="pl-c1">0</span>;

  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-c1">Scaffold</span>(
      body<span class="pl-k">:</span> <span class="pl-en">_body</span>(),
      bottomNavigationBar<span class="pl-k">:</span> <span class="pl-en">_bottomNavigationBar</span>(),
    );
  }

  <span class="pl-c1">Widget</span> <span class="pl-en">_body</span>() {
    <span class="pl-k">return</span> <span class="pl-c1">Stack</span>(
      children<span class="pl-k">:</span> <span class="pl-c1">List</span>&lt;<span class="pl-c1">Widget</span>&gt;.<span class="pl-en">generate</span>(_pageCount, (<span class="pl-c1">int</span> index) {
        <span class="pl-k">return</span> <span class="pl-c1">IgnorePointer</span>(
          ignoring<span class="pl-k">:</span> index <span class="pl-k">!=</span> _pageIndex,
          child<span class="pl-k">:</span> <span class="pl-c1">Opacity</span>(
            opacity<span class="pl-k">:</span> _pageIndex <span class="pl-k">==</span> index <span class="pl-k">?</span> <span class="pl-c1">1.0</span> <span class="pl-k">:</span> <span class="pl-c1">0.0</span>,
            child<span class="pl-k">:</span> <span class="pl-c1">Navigator</span>(
              onGenerateRoute<span class="pl-k">:</span> (<span class="pl-c1">RouteSettings</span> settings) {
                <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
                  builder<span class="pl-k">:</span> (_) <span class="pl-k">=&gt;</span> <span class="pl-en">_page</span>(index),
                  settings<span class="pl-k">:</span> settings,
                );
              },
            ),
          ),
        );
      }),
    );
  }

  <span class="pl-c1">Widget</span> <span class="pl-en">_page</span>(<span class="pl-c1">int</span> index) {
    <span class="pl-k">switch</span> (index) {
      <span class="pl-k">case</span> <span class="pl-c1">0</span><span class="pl-k">:</span>
        <span class="pl-k">return</span> <span class="pl-c1">Page1</span>();
      <span class="pl-k">case</span> <span class="pl-c1">1</span><span class="pl-k">:</span>
        <span class="pl-k">return</span> <span class="pl-c1">Page2</span>();
    }

    <span class="pl-k">throw</span> <span class="pl-s">"Invalid index $<span class="pl-v">index</span>"</span>;
  }

  <span class="pl-c1">BottomNavigationBar</span> <span class="pl-en">_bottomNavigationBar</span>() {
    <span class="pl-k">final</span> theme <span class="pl-k">=</span> <span class="pl-c1">Theme</span>.<span class="pl-en">of</span>(context);
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">BottomNavigationBar</span>(
      fixedColor<span class="pl-k">:</span> theme.accentColor,
      currentIndex<span class="pl-k">:</span> _pageIndex,
      items<span class="pl-k">:</span> [
        <span class="pl-c1">BottomNavigationBarItem</span>(
          icon<span class="pl-k">:</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.list),
          title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">"Page 1"</span>),
        ),
        <span class="pl-c1">BottomNavigationBarItem</span>(
          icon<span class="pl-k">:</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.account_circle),
          title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">"Page 2"</span>),
        ),
      ],
      onTap<span class="pl-k">:</span> (<span class="pl-c1">int</span> index) {
        <span class="pl-en">setState</span>(() {
          _pageIndex <span class="pl-k">=</span> index;
        });
      },
    );
  }
}</pre></div>
<p dir="auto">In the above code If one Of the Page has a <code class="notranslate">TextInputfield</code> And i am currently on the active page, but i am not able to tap the text input all other buttons are working, the keyboard doesn't show up, or i don't thinks it's being clicked.<br>
In the attached i am not able to tap on write message text box, i have moved its position also the issue still persist.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1706515/51431777-f6345980-1c53-11e9-8c31-bb6d0ed92091.png"><img width="267" alt="screen shot 2019-01-20 at 1 37 04 am" src="https://user-images.githubusercontent.com/1706515/51431777-f6345980-1c53-11e9-8c31-bb6d0ed92091.png" style="max-width: 100%;"></a></p>