title: How to access Provider providers in Dialogs in Flutter
body: <p>The Provider package makes use of <code>InheritedWidget</code>. This is a problem when I want to access a provider when I'm in a Dialog. If I load a dialog using </p>
  
  <pre><code> showDialog(... builder: (context) =&gt; MyDialog);
  </code></pre>
  
  <p>I can't access anything using <code>InheritedWidget</code> because my dialog isn't part of the main widget tree. This also means that I can't access my Provider providers, correct?</p>
  
  <p>My question is: How can I access my providers in a dialog if it's not part of the main app widget tree?</p>
  
  <pre><code>final firebaseAuth = Provider.of&lt;FirebaseAuth&gt;(context);
  </code></pre>
  
  <p>I have the same problem with using <code>BLoCs</code>. If I try to retrieve them in a dialog via <code>InheritedWidget</code>, they fail. I've gotten around this by passing the <code>BLoC</code> in the constructor but this seems to defeat the purpose of <code>InheritedWidgets</code>.</p>