title: Flutter remove dialogs in sequence
body: <p>I am trying to remove dialogs in a specific sequence but I am getting an following error:</p>
  
  <pre><code>E/flutter (14457): [ERROR:flutter/shell/common/shell.cc(188)] Dart Error: Unhandled exception:
  E/flutter (14457): Looking up a deactivated widget's ancestor is unsafe.
  E/flutter (14457): At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.
  </code></pre>
  
  <p>Here the sequence:</p>
  
  <ol>
  <li>List item</li>
  <li>Open Confirm dialog 1</li>
  <li>Close (onPressed) dialog 1 </li>
  <li>Open Loading dialog 2.</li>
  <li>Close (Navigator.of(context).pop())</li>
  <li>Open dialog 3 with success message.</li>
  </ol>
  
  <p>Both Dialog 1 and 2 cloese with Navigator.of(context).pop().</p>
  
  <p>How can I fix this?</p>