I have a list Named Cart and it may consist of more than 12 items and if it is more than 13 I want to create pages from it. How can I do it? The below code generates one page. Can you point me to how to build more pages?
Expanded(
child: PageView.builder(
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext context, int index) {
return
Expanded(
child: ListView.builder(
controller: scrollController,
itemCount: CartServiceV2().getCartTotalItems() > 13
? 13
: CartServiceV2().getCartTotalItems(),
itemBuilder: (context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0),
child: InvoiceWidgetV4(
item: cart[index],
id: index + 1,
),
);
}),
);
},
),
)