Flutter Wrap Builder

Viewed 45

I have a list with over 5000 models and need to display them in a Wrap. But the widget Wrap creates all the elements at once and this has a very bad effect on performance is there any way to display them as a ListView.builder

my code:

final list = [];

Wrap(
  runSpacing: 12,
  spacing: 12,
  children: List.generate(
    list.length,
    (index) => CustomChip(List[index]),
  ),
),

this is what I want to get

https://i.pinimg.com/originals/6e/dc/db/6edcdbadfe6230efef35abc93bd689ab.png

1 Answers

You can use Gridview.builder or Add use Pagination, when t=you reached the maximum scroll then load another data and add into the list which you have used Wrap.

Related