title: using Provider to avoid rebuild all widget tree in flutter
body: <p>as my understand, one of Provider benefits is to avoid rebuild the widget tree, by calling build function, but when i try it practically with this simple example:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:provider/provider.dart';
  import 'package:providerexamplelast/counterWidget.dart';
  
  void main() =&gt; runApp(ChangeNotifierProvider&lt;Provider1&gt;(
    create: (_) =&gt; Provider1(),
    child:   MaterialApp(
      home: Counter(),
    ),
  ));
  
  int n =0;
  class Counter extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      print(&quot;${n++}&quot;);
  var counter = Provider.of&lt;Provider1&gt;(context);
      return Scaffold(
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: ()=&gt; counter.counter(),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(&quot;1&quot;),
              SizedBox(height: 5,),
              countText(),
              SizedBox(height: 5,),
              Text(&quot;3&quot;),
              SizedBox(height: 5,),
              Text(&quot;4&quot;),
  
            ],
          ),
        ),
      );
    }
  }
  
  Widget countText(){
    return Builder(
      builder: (context){
        var count = Provider.of&lt;Provider1&gt;(context);
        return Text(&quot;${count.c}&quot;);
      },
    );
  } 
  </code></pre>
  <p>by using this part :</p>
  <pre><code>print(&quot;${n++}&quot;);
  </code></pre>
  <p>i noticed that (build) function is recall whenever i press the button and call (counter) function from provider?</p>
  <p>so the question here it is just (Stateless) widget, how it rebuild again? and then why i need to use Provider if it is not solve this problem?</p>
  <p>Edit: I heard about this way:</p>
  <pre><code>var counter = Provider.of&lt;Provider1&gt;(context, listen: false);
  </code></pre>
  <p>so is it solve this problem? and how?</p>