<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.0">Jekyll</generator><link href="https://quirijngb.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://quirijngb.com/" rel="alternate" type="text/html" /><updated>2023-07-26T10:35:52+00:00</updated><id>https://quirijngb.com/feed.xml</id><title type="html">Quirijn Groot Bluemink</title><subtitle>Lead Mobile Engineer - Flutter - Android</subtitle><entry><title type="html">Lazy loading data into a ScrollView</title><link href="https://quirijngb.com/2018/08/23/lazy-loading-data-into-a-scrollview.html" rel="alternate" type="text/html" title="Lazy loading data into a ScrollView" /><published>2018-08-23T11:17:19+00:00</published><updated>2018-08-23T11:17:19+00:00</updated><id>https://quirijngb.com/2018/08/23/lazy-loading-data-into-a-scrollview</id><content type="html" xml:base="https://quirijngb.com/2018/08/23/lazy-loading-data-into-a-scrollview.html">&lt;p&gt;Most apps we build are composed of some sort of scrollable list of items. Some contain so many items that the response from the API is generally paginated. As app developers we consume these API and display the data to the user. There are a couple of ways we can approach this.&lt;/p&gt;

&lt;p&gt;One is having a paginator at the bottom of the page&lt;/p&gt;

&lt;p&gt;Another approach is having an infinite scrolling list. We do this by loading more items when we approach the end of the current list and append them. Creating a seamless scrolling experience.&lt;/p&gt;

&lt;p&gt;To simplify this I’ve built a widget that will wrap a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ScrollView&lt;/code&gt; which could be a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ListView&lt;/code&gt; or a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GridView&lt;/code&gt; and provides a listener to warn you when the user is reaching the end of the list. This will allow you to preload the next batch of items.&lt;/p&gt;

&lt;p&gt;The code would look something like this:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/QuirijnGB/ba1fbe6e5998690071935436ed996ead.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;Check out the package on &lt;a href=&quot;https://pub.dartlang.org/packages/lazy_load_scrollview&quot;&gt;pub&lt;/a&gt; or the code over in &lt;a href=&quot;https://github.com/QuirijnGB/lazy-load-scrollview&quot;&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Photo by &lt;a href=&quot;https://unsplash.com/photos/FVtG38Cjc_k?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Marten Bjork&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="flutter" /><category term="dart" /><summary type="html">Most apps we build are composed of some sort of scrollable list of items. Some contain so many items that the response from the API is generally paginated. As app developers we consume these API and display the data to the user. There are a couple of ways we can approach this.</summary></entry></feed>