i have a listview builder . i have custom widget (like dropdown) for show in listview. i need to close all widgets when i click another one. i mean in all list only one widget can be open. can anybody help me?
return Column(
children: [
InkWell(
onTap: () {
setState(() {
isHide = !isHide;
if (isHide) {
height = 0;
} else {
height = 10;
}
});
},
child: Container(
child: Container(
width: double.infinity,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(
text: this.widget.title,
size: 15,
textColor: Colors.grey,
),
SizedBox(
height: 5,
),
height < 1
? Container(
child: AnimatedContainer(
height: height,
duration: Duration(milliseconds: 1),
child: TextWidget(
text: this.widget.mainText,
textColor: Colors.grey,
size: 10,
),
),
)
: Container(
height: 100,
child: AnimatedContainer(
height: height,
duration: Duration(milliseconds: 1),
child: TextWidget(
overfloww: TextOverflow.fade,
text: this.widget.subText,
textColor: Colors.grey,
size: 15,
),
this is my custom widget