title: Flutter dismiss selected dialog with Getx
body: <p>I am using flutter for quite some time and recently use Get to implement state management.
  I am facing a problem when opening a loading dialog 1st and then message dialog. Then I want to dismiss the loading dialog, but the message dialog is the one that keep dismiss.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:get/get.dart';
  
  class HomeController extends GetxController {
  
    Future&lt;void&gt; openAndCloseLoadingDialog() async {
      showDialog(
        context: Get.overlayContext,
        barrierDismissible: false,
        builder: (_) =&gt; WillPopScope(
          onWillPop: () async =&gt; false,
          child: Center(
            child: SizedBox(
              width: 60,
              height: 60,
              child: CircularProgressIndicator(
                strokeWidth: 10,
              ),
            ),
          ),
        ),
      );
  
      await Future.delayed(Duration(seconds: 3));
  
      Get.dialog(
        AlertDialog(
          title: Text(&quot;This should not be closed automatically&quot;),
          content: Text(&quot;This should not be closed automatically&quot;),
          actions: &lt;Widget&gt;[
            FlatButton(
              child: Text(&quot;CLOSE&quot;),
              onPressed: () {
                Get.back();
              },
            )
          ],
        ),
        barrierDismissible: false,
      );
  
      await Future.delayed(Duration(seconds: 3));
  
      Navigator.of(Get.overlayContext).pop();
    }
  }
  </code></pre>
  <p>The above code dismisses the 2nd dialog, not the 1st dialog which what I want.
  Can anyone give advice on this matter.</p>