I am trying to add borders for each item in an expansion panel in Flutter.
I achieved the below by the code below.
The problem is that the border lines doesn’t cover entire width, but only till the up/down arrow.
I want the border to be full.
Can anyone please help me?
ExpansionPanel(
canTapOnHeader: true,
headerBuilder:
(BuildContext context, bool isExpanded) {
return Container(
margin: const EdgeInsets.symmetric(
vertical:
4.0), // Add vertical margin to separate panels
decoration: const BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.grey, // Border color
width: 1.0, // Border width
),
bottom: BorderSide(
color: Colors.transparent, // Border color
width: 1.0, // Border width
),
),
),
child: ListTile(
title: Text(
'Which city do you want to travel from?',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(
height: 1.5,
color: const Color(0xFF171A1F),
),
)),
);
},
.....//the body code