title: Error: RangeError (index): Index out of range: index should be less than 10: 10
body: <p>I am trying to create a Lazy Loading Widget but it gives me this error:</p>
  <blockquote>
  <p>Error: RangeError (index): Index out of range: index should be less than 10: 10</p>
  </blockquote>
  <p>this is where the build error occurres:</p>
  <pre><code>  @override
    Widget build(BuildContext context) {
      return LazyLoadScrollView(
        isLoading: isLoading,
        onEndOfPage: () =&gt; _loadMore(),
        child: ListView.builder(
          itemCount: data.length,
          itemBuilder: (context, index) {
                return data[index];
          },
        ),
      );
    }
  </code></pre>
  <p>this is my entire script:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
  
  class LazyLoad extends StatefulWidget {
    final List&lt;Widget&gt; children;
  
    const LazyLoad({Key? key, required this.children}) : super(key: key);
  
    @override
    _LazyLoadState createState() =&gt; _LazyLoadState();
  }
  
  class _LazyLoadState extends State&lt;LazyLoad&gt; {
    List&lt;Widget&gt; data = [];
    int currentLength = 0;
  
    final int increment = 2;
    bool isLoading = false;
  
    @override
    void initState() {
      _loadMore();
      super.initState();
    }
  
    Future _loadMore() async {
      setState(() {
        isLoading = true;
      });
  
      for (var i = currentLength; i &lt;= currentLength + increment; i++) {
        data.add(widget.children[i]);
      }
      setState(() {
        isLoading = false;
        currentLength = data.length;
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return LazyLoadScrollView(
        isLoading: isLoading,
        onEndOfPage: () =&gt; _loadMore(),
        child: ListView.builder(
          itemCount: data.length,
          itemBuilder: (context, index) {
                return data[index];
          },
        ),
      );
    }
  }
  </code></pre>
  <p>The code works! But I wanted to get rid of the error somehow.
  I am already using itemCount: in the ListView.builder ad culdn't find out what the problem is. Any ideas?</p>