flutter divider: How could i add divider between each line in my code?

前端 未结 7 1325
野趣味
野趣味 2020-12-02 12:00

How could i add divider to list? I use flatter for android. I want to add a divider between each line and I want to colorize the divider and add styles.

I tried to

相关标签:
7条回答
  • 2020-12-02 13:02

    Check out this issue: ListView.builder should let clients specify a divider It makes clear that:

    1. if you need to build your list with dynamic elements, for now you'll have to deal with this issue on your own. I'd recommend in the row widget building, you include a List Divider at the bottom with a column or something, except for the last one (you can test for index == listData.length - 1).

    2. But if, like in the example you show, you already know all the lists data before hand, or you build it without a ListView.builder, then you can and should use the named constructor ListView.divideTiles

    0 讨论(0)
提交回复
热议问题