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
On the flutter getting started tutorial it is covered, the solution they provide is something like this:
body: ListView.builder(
itemCount: _kittens.length,
itemExtent: 60.0,
itemBuilder: (context, i) {
// Add a one-pixel-high divider widget before each row in theListView.
if (i.isOdd) return new Divider(color: Colors.purple); // notice color is added to style divider
return _listItemBuilder();
},
),
...
That should add the dividers taking into account the odd and even rows to do so.
Also to color the divider pas "color" to the Divider Class:
new Divider(color: Colors.purple);