title: How to properly reuse a Provider in Flutter
body: <p>So I have this ChangeNotifierProvider high in my widget tree as I am seeing many children widgets to listen to its value.</p>
  
  <p>What I am currently doing is that I pass down the <strong>Provider.of(context)</strong> object from the parent widget into it's children via constructors whenever I am to reuse some values/functions on my children widgets. For example, everytime I create a <strong>Provider.of(context)</strong> object for my children widgets, it seems that it does not carry over the updated values I have on the Parent Provider but rather this one has my default null/0/'empty' ones like it has only been created. This lead me to pass down the initial <strong>Provider.of(context)</strong> object to each children that will use the updated values and functions of the ChangeNotifier.</p>
  
  <p>This setup is working for me, however, when my Widget Tree has started being complex, I am constantly passing down values through each widget and to some that do not even use it at all just for its children to listen to the main provider.</p>
  
  <p>I think what I may be doing now is anti-pattern of the Provider Architecture, I am hoping you guys can help me on a more optimized and efficient way of doing this.</p>
  
  <p>Thank you very much!</p>
  
  <p>P.S. There are some things in the documentation that I am not yet quite grasping properly.</p>
  
  <p>Edits Below to include sample code and visualization:</p>
  
  <p><strong>provider_type.dart</strong></p>
  
  <pre><code>class ProviderType extends ChangeNotifier{
      String valueA = '';
      String valueB = '';
  }
  </code></pre>
  
  <p><strong>home.dart</strong></p>
  
  <pre><code>import ..provider_type.dart
  ...
      Widget build(BuildContext context){
          return ChangeNotifierProvider&lt;ProviderType&gt;(
              create: (context) =&gt; ProviderType(),
              child: ScreenColumn();
          );
      }
  ...
  </code></pre>
  
  <p><strong>screen_column.dart</strong></p>
  
  <pre><code>import ..screen_a.dart
  import ..screen_b.dart
  class ScreenColumn extends StatelessWidget{
      Widget build(BuildContext context){
          var providerType = Provider.of&lt;ProviderType&gt;(context);
  
          return Column(
              children: &lt;Widget&gt;[
                  ScreenA(providerType: providerType),
                  ScreenB(providerType: providerType),
              ],
          );
      }
  }
  </code></pre>
  
  <p><strong>screen_a.dart</strong></p>
  
  <pre><code>class ScreenA extends StatelessWidget{
      final ProviderType providerType;
  
      ScreenA({this.providerType});
  
      Widget build(BuildContext context){
          return Text(
              '${providerType.valueA}'
          );
      }
  }
  </code></pre>
  
  <p><strong>screen_b.dart</strong></p>
  
  <pre><code>import ..screen_c.dart
  class ScreenB extends StatelessWidget{
      final ProviderType providerType;
  
      ScreenB({this.providerType});
  
      Widget build(BuildContext context){
          return ScreenC(providerType: providerType);
      }
  }
  </code></pre>
  
  <p><strong>screen_c.dart</strong></p>
  
  <pre><code>class ScreenC extends StatelessWidget{
      final ProviderType providerType;
  
      ScreenB({this.providerType});
  
      Widget build(BuildContext context){
          return Column(
          children: &lt;Widget&gt;[
              Text(
                  '${providerType.valueA}'
              )
              Text(
                  '${providerType.valueB}'
              )
              Text(
                  '${providerType.valueC}'
              )
          ]
          );
      }
  }
  </code></pre>
  
  <p><strong>Visualization</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SLNbn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SLNbn.png" alt="enter image description here"></a></p>
  
  <p>So what I am currently doing is to pass down the object <strong>providerType</strong> from ScreenColumn to Screens A, B, and C just so each of them have the same "Source of Values". Cause when I try to make different Provider.of objects and use them, they do not share the same updated values when I do some computation.</p>
  
  <p>Is there something I can do to make this more efficient or is there a better way that I need to do?</p>