title: Flutter - How to create a CupertinoAlertDialog
body: <p>I'm trying to create an iOS <code>CupertinoAlertDialog</code> on my Flutter project using the following code:</p>
  
  <pre><code>   showDialog(
        context: context,
        builder: (BuildContext context) =&gt; new CupertinoAlertDialog(
          title: new Text("Alert"),
          content: new Text("My alert message"),
          actions: [
            CupertinoDialogAction(isDefaultAction: true, child: new Text("Close"))
          ]));
  </code></pre>
  
  <p>However, when call this dialog I receive the following error message:</p>
  
  <p><code>NoSuchMethodError: The getter 'alertDialogLabel' was called on null</code></p>
  
  <p>The Android <code>AlertDialog</code> works properly.</p>
  
  <p>What is wrong with this code?</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p>Solution: <a href="https://github.com/flutter/flutter/issues/23047#issuecomment-559087527" rel="noreferrer">CupertinoAlertDialog crash</a></p>
  
  <p>Just add <code>GlobalCupertinoLocalizations.delegate</code> to your MaterialApp.</p>