|
|
|
|
@ -47,7 +47,7 @@ class ExpandableListView extends StatefulWidget {
|
|
|
|
|
final List<String> resultDistance;
|
|
|
|
|
final List<DoctorList> doctorsList2;
|
|
|
|
|
final val;
|
|
|
|
|
|
|
|
|
|
static int doctorListheight = 0;
|
|
|
|
|
const ExpandableListView(
|
|
|
|
|
{Key key, this.result2, this.resultDistance, this.val, this.doctorsList2})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
@ -59,8 +59,6 @@ class ExpandableListView extends StatefulWidget {
|
|
|
|
|
class _ExpandableListViewState extends State<ExpandableListView> {
|
|
|
|
|
bool expandFlag = false;
|
|
|
|
|
|
|
|
|
|
var _radioValue1;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return new Container(
|
|
|
|
|
@ -112,6 +110,10 @@ class _ExpandableListViewState extends State<ExpandableListView> {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
expandFlag = !expandFlag;
|
|
|
|
|
if (expandFlag == true) {
|
|
|
|
|
setDoctorViewHeight(
|
|
|
|
|
widget.result2[widget.val].toString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
@ -146,6 +148,11 @@ class _ExpandableListViewState extends State<ExpandableListView> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setDoctorViewHeight(name) {
|
|
|
|
|
ExpandableListView.doctorListheight =
|
|
|
|
|
widget.doctorsList2.where((e) => e.projectName == name).toList().length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getProjectDistance(String distance) {
|
|
|
|
|
if (distance != "0")
|
|
|
|
|
return " - " + distance + " " + TranslationBase.of(context).km;
|
|
|
|
|
@ -178,9 +185,12 @@ class ExpandableContainer extends StatelessWidget {
|
|
|
|
|
duration: new Duration(milliseconds: 500),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
width: screenWidth,
|
|
|
|
|
height: expanded ? MediaQuery.of(context).size.height : collapsedHeight,
|
|
|
|
|
height: expanded
|
|
|
|
|
? (ExpandableListView.doctorListheight * 160).toDouble()
|
|
|
|
|
: collapsedHeight,
|
|
|
|
|
child: new Container(
|
|
|
|
|
child: child,
|
|
|
|
|
padding: EdgeInsets.only(bottom: 30),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
border: new Border.all(width: 1.0, color: Colors.white)),
|
|
|
|
|
),
|
|
|
|
|
|