Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - How to make lazy loading on PageView?

How to lazily load widget in a PageView?

like image 565
zukijuki Avatar asked Jun 26 '19 09:06

zukijuki


People also ask

How do I get current index of PageView in flutter?

You can use PageView. builder, it will give you page index.

What is Page snapping flutter?

Snapping Page ScrollA plugin that acts similar to a PageView but either snaps to the closest page or scrolls multiple pages and then snaps, based on how fast the user scrolls.


1 Answers

You can use PageView.builder for this.

Example:

PageView.builder(
  itemCount: 100,
  itemBuilder: (context, index) => YourWidget(),
),
like image 134
CopsOnRoad Avatar answered Nov 15 '22 06:11

CopsOnRoad