Issue
I'm getting some weird white space when I drag the item to reorder it that is defined nowhere. How can I get rid of the white spacing and extend the card to fill this space? That's how the white spacing looks like when reordering the item:
href="https://i.stack.imgur.com/XTXOo.jpg" rel="nofollow noreferrer">
And that's my code to build the body of the Scaffold:
body:
Stack(
children: [
Positioned(
child: ReorderableListView.builder(
buildDefaultDragHandles: false,
itemCount: widget.cards.length,
itemBuilder: (context, index) {
return Dismissible(
key: Key(widget.cards[index].name),
onDismissed: (direction) {
setState(() {});
},
child:
Card(
child:
SizedBox(
height: 75,
child: ListTile(
tileColor: Colors.red.shade200,
title: Text(widget.cards[index].name),
trailing: ReorderableDragStartListener(
index: index,
child: const Icon(Icons.drag_handle),
),
onTap: (){
},
),
),
),
);
},
),
)
])
Solution
In your case Padding appear of Card Widget default margin. You can remove using this code . If you remove that not show the elevation of Card Widget. If you dont want that you can remove Card Widget.
Card(
margin: EdgeInsets.all(0),
child: SizedBox( .......
Answered By - K K Muhammed Fazil
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)