When I build my page I want my dayTile widgets to be in a row of 2. I don't know how many the user will desire so I need to use a listView.Builder. The problem I am facing is that the way I am building only works when the array has an even number of items.
ListView.builder(
itemCount: dayTiles.length,
itemBuilder: ((context, index) {
return index.isEven
? Row(
children: [
dayTiles[index],
dayTiles?[index + 1] ?? Container(),
],
)
: Container();
}),
),
How would I make this return a row with only one dayTile in it, with the other space empty?