flutterflutter-layout

How to add space between items in a ReorderableListView?


  return ReorderableListView(
      children: [
        for (int index = 0; index < _items.length; index++)
          ListTile(
            key: Key('$index'),
            title: Text('Item $index'),
          ),
      ],
      onReorder: (int oldIndex, int newIndex) {},
    );

Is there a way to add some spacing between each item?


Solution

  • Wrap ListTile with Padding like below,

          Padding(
            padding: const EdgeInsets.all(8.0) //your choice
            ListTile(
              key: Key('$index'),
              title: Text('Item $index'),
            ),
          )