title: Create Pop-Up Dialog in Flutter
body: <p>I am needing a way to create a pop-up dialog in flutter.</p>
  <p><a href="https://i.stack.imgur.com/6Xjfb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Xjfb.png" alt="enter image description here" /></a></p>
  <p>I have was able to create the 'two-toned' design as desired, and a dialog, but I am unable to find a way to pop-up the dialog once a user clicks a button to navigate to this screen.</p>
  <p>Code for creating the view:</p>
  <pre><code>class CreateID extends StatelessWidget {
    const CreateID({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: cPrimaryColor,
        body: SafeArea(
          child: Column(
            children: [
              Expanded(
                child: Container(
                  width: double.infinity,
                ),
              ),
              Expanded(
                child: Container(
                  width: double.infinity,
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(20.0),
                      topRight: Radius.circular(20.0)
                    )
                  ),
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>Here is the code for the dialog:</p>
  <pre><code>class PopUp extends StatelessWidget {
  const PopUp({Key? key}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
  return Scaffold(
    body: SafeArea(
      child: FutureBuilder&lt;dynamic&gt;(
          future: showDialog(
              context: context,
              builder: (BuildContext context) {
                return AlertDialog(
                  content: Stack(
                    overflow: Overflow.visible,
                    children: &lt;Widget&gt;[
                      Positioned(
                        right: -40.0,
                        top: -40.0,
                        child: InkResponse(
                          onTap: () {
                            Navigator.of(context).pop();
                          },
                          child: CircleAvatar(
                            child: Icon(Icons.close),
                            backgroundColor: Colors.red,
                          ),
                        ),
                      ),
                      Form(
  //key: _formKey,
                        child: Column(
                          mainAxisSize: MainAxisSize.min,
                          children: &lt;Widget&gt;[
                            Padding(
                              padding: EdgeInsets.all(8.0),
                              child: TextFormField(),
                            ),
                            Padding(
                              padding: EdgeInsets.all(8.0),
                              child: TextFormField(),
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                );
              }),
          builder: (BuildContext context, AsyncSnapshot&lt;dynamic&gt; 
  snapshot) {
            throw UnimplementedError;
          }),
    ),
  );
  }
  }
  </code></pre>
  <p>The ideal result would be when the user is 'pushed' (by clicking a button) to the CreateID screen, it would popup the dialog.</p>