title: How to handle clicking (taping) outside bottom sheet in flutter? if tapped outside the botton sheet display alert dialog instead of closing the sheet
body: <p>How to handle clicking (taping) outside bottom sheet in flutter? if tapped outside the botton sheet display alert dialog instead of closing the sheet
  the following code I used to show the bottom sheet with txt field auto focus</p>
  <pre><code>_showBottomSheet(ctx)
    {
      Future&lt;void&gt; future =
      
      showModalBottomSheet(
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.vertical(top: Radius.circular(10.0))),
          backgroundColor: Colors.white,
          context: ctx,
          isScrollControlled: true,
          builder: (context) =&gt; WillPopScope(
            onWillPop: ()async {print('back arrow pressed'); return true;},
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal:18 ),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 4.0),
                    child: TextFormField(
                      //onFieldSubmitted: (_){print('feilds submitted');},
                      textInputAction: TextInputAction.next,
                      decoration: InputDecoration(
  
                          hintText: 'text field1.',
                          border: InputBorder.none
                          ),
                      autofocus: true,
                 
                    ),
                  ),
                  SizedBox(
                    height: 8.0,
                  ),
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 4.0),
                    child: TextFormField(
                      textInputAction: TextInputAction.next,
                      decoration: InputDecoration(
  
                          hintText: 'test field 2',
                          border: InputBorder.none
                      ),
                      autofocus: true,
          
                    ),
                  ),
                  SizedBox(height: 10),
                  Padding(
                    padding: EdgeInsets.only(
                        bottom: MediaQuery.of(context).viewInsets.bottom),
                    child: Row(
                      children: [
                        ElevatedButton(
                          onPressed: (){},
                          child: Icon(Icons.save),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ))
            print('this is then function called after closing bottom sheet');
          });
  
       
    }
  </code></pre>