title: How to dismiss alert dialog when clicked outside of it
body: <p>I have an alert dialog that I want to be dismissed when clicked outside of it, I know this is the default behavior of alert dialogs in flutter, but I don't know what's the problem that's preventing it from closing when clicked outside.</p>
  
  <p>I tried to use barrierDismissable to true, but still, it doens't work.</p>
  
  <pre><code>This is my dialog : 
  
  termsAndConditionsDialog(BuildContext context) {
  
      AlertDialog alert = AlertDialog(
        title:  Text("Terms and Conditions", style: TextStyle(fontSize: 18, color: AppColors.accentColor),),
        content: Text(
          generalSettings.policyForCustomer,
          style: TextStyle(fontSize: 16),
        ),
  
      );
  
  
      // show the dialog
      showDialog(
        barrierDismissible: true,
        context: context,
        builder: (BuildContext context) {
          return alert;
        },
      );
    }
  
  
  and this is how I call it from button's onPressed : 
   termsAndConditionsDialog(context);
  </code></pre>