小编Mar*_*yns的帖子

Can Flutter efficiently layout nested lists?

Can a layout like this be achieved and rendered efficiently in Flutter?

Example:

在此输入图像描述

Yellow and blue blocks can both be around 30 elements, so I guess something like ListView.builder should be used.

I have tried nesting 2 ListView.builder, the inner with shrinkWrap = true. The yellow block is being built just when is needed, but the blue list, although it has an itemBuilder, it builds all children elements at once, causing performance problems.

new ListView.builder(
  itemCount: 20,
  itemBuilder: (BuildContext context, …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-sliver flutter-layout

6
推荐指数
0
解决办法
1165
查看次数

标签 统计

flutter ×1

flutter-layout ×1

flutter-sliver ×1