title: Flutter FutureBuilder with REST JSON paging
body: <p>I take JSON data to <code>Future&lt;List&lt;Data&gt;&gt; _DataList;</code>  with this method
  and URL like <code>https://nomer.biz.ua/mobile/kievstar?page=1</code></p>
  <pre><code>Future&lt;List&lt;Data&gt;&gt; getData(int pageCount) async {
  String url = Uri.encodeFull(&quot;https://nomer.biz.ua/mobile/kievstar?page=$pageCount&quot;);
  var response = await http.get(url, headers: {&quot;Accept&quot;: &quot;application/json&quot;}).timeout(const Duration(seconds: 10));
  final Map res = json.decode(response.body);
  Response model = Response.fromJson(res);
  page++;
  return model.data;
  }
  </code></pre>
  <p>And pass them to FutureBuilder</p>
  <pre><code>@override
   Widget build(BuildContext context) {
    return Scaffold(
      body:FutureBuilder(
        future: _DataList,
         builder: (BuildContext ctx, AsyncSnapshot&lt;dynamic&gt; snapshot){
  
           if (snapshot.connectionState != ConnectionState.done) {
               return Center(child: CircularProgressIndicator());
          }
  
          if (snapshot.hasError) {
            return Center(child: Text(&quot;Error&quot;));
          }
          if (!snapshot.hasData) {
            return Center(child: Text(&quot;Error&quot;));
          }
  
          var  dataToShow = snapshot.data;
  
          return  ListView.builder(
             controller: _controller,
             itemCount: dataToShow == null ? 0 : dataToShow.length,
             itemBuilder: (context, index) {
               final item = dataToShow[index];
               return Card(
                    //SHOW DATA 
               );
             });
    }
    )
  );
  }
  </code></pre>
  <p>Invoke new page on</p>
  <pre><code>  @override
    void initState() {
       _DataList = getData(page);
  
      super.initState();
      _controller.addListener(() {
        if (_controller.position.pixels == _controller.position.maxScrollExtent) {
          _DataList= getData(page);
        }
      });
    }
  </code></pre>
  <p>The first page is displayed, but others are not processed. I load a new page, at the moment of scrolling the list to its last element. <code>_DataList = getData(page);</code> receives JSON data from 2 pages, but does not pass them to FutureBuilder.
  I could not find a real example where url page navigation is implemented and FutureBuilder together.</p>