Wrap.builder implementation

Viewed 54

Is there any way to implement Wrap.builder to make the widget tree build only widgets that are on-screen, not all of the children at once like ListView.builder does?

Example

final myList= List.Generate(25,(i)=>'index: ${i+1}');
Wrap.builder(
    itemCount: myList.length,
    itemBuilder: (context,i) => Text(myList[i]),
);
1 Answers

Wrap does not do that, only Sliver-based widgets can render stuff on the fly. If performance is not an issue, do not over-optimize and continue to use stuff such as Wrap or Column. If you have identified a real performance issue, consider switching to slivers - such as ListView or other slivers.

Related