Here is the gesture Detector in which I am using setstate inside
gesture detector and I've applied check on expansion tile:
Future<void> showModel(BuildContext context) {
bool openList=false;
return showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return Container(
child:ListView(
shrinkWrap: true,
children: [
GestureDetector(
onTap: (){
setState(() {
openList=true;
});
},
child: Image.asset('assets/icons/diirection.png',
height: Get.height * 0.05)),
openList==false? ExpansionTile(
tilePadding: EdgeInsets.all(0),
title:itemRow(),
children: [
itemDetails()
],
):Text('data'),
]
),
);
},
);
}
and here the widget which I want to change on tap.
openList==false? ExpansionTile(
tilePadding: EdgeInsets.all(0),
title:itemRow(),
children: [
itemDetails()
],
):Text('data'),