space between items in listview flutter code example

Example 1: flutter vertical space between containers

Column(
  children: <Widget>[
    Widget1(),
    SizedBox(height: 10),
    Widget2(),
  ],
),

Example 2: flutter listview space between items

// Use ListView.separated()

ListView.separated(
	separatorBuilder: (BuildContext context, int index) {
		return SizedBox(
				height: 5,
                );
		},
	itemCount: zones.length,
	itemBuilder: (_, i) => cardStyleZone(zones[i]),
),

Example 3: flutter reorderable list view dividers

//in children property of ReorderableListView
children: [
        for(final item in menu.dishCategories)
          Column(
            key: ValueKey(item),
            //set mainAxisSize to min to avoid items disappearing on reorder
            mainAxisSize: MainAxisSize.min,
            children: [
              ExpansionTile(
                leading: Icon(Icons.menu),
                title: Text(item, style: regularTextStyle),
                children: [

                ],
              ),
              Divider(height: 0)
            ],
          )
      ],

Tags:

Dart Example