title: Display pop up menu when icon button widget is clicked Flutter
body: <p>I have made an alert dialog where user can update their profile details. In that with image container there is icon button widget. What I want is that when user clicks icon button, pop up menu will display with add/remove image option. Here is my code for alert dialog:</p>
  <pre><code>showDialog&lt;void&gt;(
    builder: (BuildContext context) {
      return AlertDialog(
        title: Text('Update details'),
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0))),
        content: StatefulBuilder(
          builder: (context, setState) { return Container(
            width: 400,
            child: Form(
              key: _formKey,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: &lt;Widget&gt;[
                  Stack(
                      alignment: Alignment.center,
                      children: [
                        Container(
                            width: 100.0,
                            height: 100.0,
                            decoration: new BoxDecoration(
                                shape: BoxShape.circle,
                                image: new DecorationImage(
                                    fit: BoxFit.cover,
                                    colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.darken),
                                    image: data != null ? MemoryImage(data) : AssetImage(&quot;web/icons/contactsDefaultImage.png&quot;)
                                )
                            )
                        ),
                        IconButton(icon: Icon(Icons.edit), onPressed: () async {
                           //display option here
                           _showPopupMenu();
                        })
                      ]),
                  Container(
                    child: TextFormField(
                      decoration: InputDecoration(
                          labelText: 'name'
                      ),
                    ),
                  ),
                  TextFormField(
                    decoration: InputDecoration(
                        labelText: 'email'
                    ),
                  ),
                ],
              ),
            ),
          );},
        ),
        actions: &lt;Widget&gt;[
          FlatButton(
            child: Text('Cancel'),
            onPressed: () {
              Navigator.of(context).pop();
            },
          ),
          FlatButton(child: Text('Save'),
            onPressed: () {
            // save
            },
          )
        ],
      );
    },
  );
  </code></pre>
  <p>I tried to user showMenu for that. But as the position has to be hard-coded I don't was to use it.
  what I tried:</p>
  <pre><code>void _showPopupMenu() async {
  await showMenu(
    context: context,
    position: RelativeRect.fromLTRB(100, 100, 100, 100),
    items: [
      PopupMenuItem(
        child: Text(&quot;add&quot;),
      ),
      PopupMenuItem(
        child: Text(&quot;remove&quot;),
      ),
    ],
    elevation: 8.0,
  );
  </code></pre>
  <p>}</p>
  <p>Now, what i want to know is how can i display it where the icon-button is tapped (without hard-coding the value). And is there another way to do it .i.e without using showMenu.</p>