Sitemap
Go With Flutter

Flutter Tips & Tricks.

30 Flutter Tips| FT29: Pagination In Flutter

3 min readDec 14, 2022

--

Flutter Tips 29 of #30FlutterTips With LakshydeepVikram series which had explored about infinite scroll or pagination in Flutter.
You can search for #30FlutterTips for more. If you like this series, please don’t forget to share with #30FlutterTips tag.

Press enter or click to view image in full size

FT29: Pagination In Flutter

We will be doing this without the use of any packages.

* Make a list of items

List<int> list = List.generate(20, (index) => index);

* Define one scrollController and bool variable

final _controller = ScrollController();
bool _isMoreData = false;

* Display all the list of item using ListViewBuilder or ListView having length more than one (+1) and put the controller inside it which we had defined early

ListView.builder(
itemCount: list.length + 1,
controller: _controller,
itemBuilder: (context, index) {
if (index < list.length) {…

--

--

Lakshydeep Vikram
Lakshydeep Vikram

Written by Lakshydeep Vikram⁠

Software Developer | Google Dev Library Author | Flutter Enthusiast