title: Flutter - popup menu isn't closed after selecting an item
body: <p>I am experimenting with Flutter and having a problem with <code>PopupMenuButton</code>. After selecting an item in the menu I show a new screen without the menu, and after I navigate back the popup menu is still open - as shown in the following screenshots:</p>
  
  <p><a href="https://i.stack.imgur.com/pgwQh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pgwQh.png" alt="Popup menu"></a>
  <a href="https://i.stack.imgur.com/VSlCR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VSlCR.png" alt="Edit profile"></a></p>
  
  <p>After navigating back from the edit profile screen (2nd screenshot) to the account screen (1st screenshot) the pop up menu is still open. I would like it to be closed. The relevant code where I create the popup menu inside an appbar:</p>
  
  <pre><code>      actions: &lt;Widget&gt;[
      new PopupMenuButton(
        itemBuilder: (BuildContext context) {
          return &lt;PopupMenuEntry&gt;[
            new AppBarMenuItem("Edit profile", () =&gt; Navigator.pushNamed(context, Routes.editProfile)).build(context),
            new AppBarMenuItem("Option 1", () =&gt; {}).build(context),
            new AppBarMenuItem("Option 2", () =&gt; {}).build(context),
            new AppBarMenuItem("Option 3", () =&gt; {}).build(context),
            new AppBarMenuItem("Option 4", () =&gt; {}).build(context),
          ];
        },
      ),
    ],
  </code></pre>
  
  <p>And the <code>AppBarMenuItem</code>:</p>
  
  <pre><code>new PopupMenuItem(
    child: new InkWell(
      child: new Text(_label),
      onTap: _onTap,
  )
  </code></pre>
  
  <p>How can I make sure that the popup menu gets closed after selecting an item? It looks like if I just use <code>PopupMenuItem</code> in my <code>PopupMenuButton</code> and navigate to the new screen in the <code>onSelected</code> function the menu closes properly. But when I use the <code>onTap</code> function of <code>InkWell</code> it doesn't close anymore.</p>