title: Flutter how to avoid PageView items being called multiple times
body: <p>I noticed that my items inside my <code>PageView.Builder</code> are <strong>called multiple times</strong>, if I start swiping to the next page. As I learned so far, listening to the values of the <code>pagecontroller</code> with <code>addListeners()</code> does its job. It seems like this is also the reason, why my items inside the <code>PageView.Builder</code> are called multiple times.</p>
  
  <p>How can I prevent that? Every time I swipe, I want it only called a single time.</p>
  
  <p><strong>This is my pageview (simplified code, <code>ChildItem</code> is wrapped by <code>GestureDetector</code>):</strong></p>
  
  <pre><code>  var currentPageValue = 0.0;
    PageController controller = PageController(viewportFraction: 1, keepPage: false);
  
  
  
  @override
    void initState() {
      super.initState();
        controller..addListener(() {
        setState(() {     
          currentPageValue = controller.page;
        });
      });
    }
  
   body: PageView.builder(
            physics: NeverScrollableScrollPhysics(),
            controller: controller,
             itemBuilder: (ctx, i) =&gt; ChangeNotifierProvider.value(
                value: list[i],
                child: Transform(
                  child: ChildItem(), &lt;--- This is beeing called multiple times when swiping
                  transform: animationController(context, i),
                  alignment: animationAlignmentController(context, i),
                ),
              ),
              childCount: list.length,
            ),
          ));
  </code></pre>