title: How to rebuild specified widgets only in flutter
body: <p>When calling onClick(), how can I prevent only WidgetOne is rebuild, while WidgetTwo is not?</p>
  <pre><code>class SomeClass extends StatefulWidget {
    @override
    State&lt;SomeClass&gt; createState() =&gt; _SomeClass();
  }
  
  class _SomeClass extends State&lt;SomeClass&gt;{
    int _i = 0;
  
  @override
    Widget build(BuildContext context) {
      return child: Column(
               children: [
                 WidgetOne(i: _i),
                 WidgetTwo()
             ],
      )
  }
  
  void onClick() {
      setState(() {
        i++;
      });
  }
  
  
  </code></pre>
  <p>I add the following text, because otherwise stackoverflow is written &quot;It looks like your post is mostly code; please add some more details.&quot; :(</p>