I am trying to place a ExpansionTile inside a nested ListView Builder. Unfortunately despite all attempts I am unable to make the ListView items inside the ExpansionTile scrollable.
Kind of attempted to use ClampPhysics and NeverClampPhysics but dont seem to work.
Any ideas how I can get that done? Any pointers? Am I doing anything wrong?
Here is the code.
body: SingleChildScrollView(
child: Column (
children: <Widget>[
ListTile(
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Card(
child: Text(' Sunrise : '+DateFormat.jms().format(DateTime.fromMillisecondsSinceEpoch(yamistart))),
),
Card(
child: Text(' Sunset : '+DateFormat.jms().format(DateTime.fromMillisecondsSinceEpoch(yamiset))),
),
],
),
),
Card(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: paksList == null ? 0 : paksList.length,
itemBuilder: (BuildContext context, int index){
/* Custom Code Here */
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
elevation: 8.0,
margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
child: Container(
decoration: BoxDecoration(color: (yfrom >= valnow || valnow >= yto) ? Color.fromRGBO(40, 75, 50, .9) : Color.fromRGBO(9, 72, 135, .9), border: Border.all(color: (yfrom >= valnow || valnow >= yto) ? Colors.redAccent : Colors.lightBlue)),
child: (yfrom >= valnow || valnow >= yto) ? ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
title: Column(
children: <Widget>[
Text(
"Current Rhythm",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
]),
trailing: (yfrom >= valnow || valnow >= yto) ? null : Icon(Icons.keyboard_arrow_down_rounded) ,
) : ExpansionTile(
tilePadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
title: SingleChildScrollView(
child: Column(
children: <Widget>[
Text(
"Current Rhythm",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
])),
children: [
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: TestList == null ? 0 : TestList.length,
itemBuilder: (BuildContext context, int index){
/* Custom Code */
if (color == "Red"){
myColor = Colors.red;
}
else if (color == "Green"){
myColor = Colors.lightGreenAccent;
}
else {
myColor = Colors.yellow;
}
if (index ==0){
yfroms = yfrom;
ytos = yfroms+ duration*60*1000;
}
else{
yfroms = ytos;
ytos = ytos+duration*60*1000;
}
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
elevation: 8.0,
margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
child: Container(
decoration: BoxDecoration(color: myColor, border: Border.all(color: Colors.lightBlue)),
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
title: Container(
child: Column(
children: <Widget>[
Text(
"Current Rhythm : Silence ",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
]),
),
),
));
},)
],
// trailing: (yfrom >= valnow || valnow >= yto) ? null : Icon(Icons.keyboard_arrow_down_rounded) ,
),
),
);
},
),
)])),
);