busList function
Implementation
Widget busList(int idx, Function _containsFilter, Function _jumpMap) {
return ScrollablePositionedList.builder(
itemCount: busTimeLists[idx].length,
initialScrollIndex: _getTimeIndex(busTimeLists[idx]),
itemBuilder: (context, index) {
var curStopList = busStopLists[idx];
var curTimeList = busTimeLists[idx];
if (!_containsFilter(curStopList, curTimeList, index) ||
curTimeList[index] == "- - - -") {
return null;
}
return Card(
child: ListTile(
leading: Icon(Icons.directions_bus),
title: Text(curStopList[index % curStopList.length][0]),
subtitle: Text(curTimeList[index]),
trailing: Icon(Icons.arrow_forward),
onTap: () {
_jumpMap(double.parse(curStopList[index % curStopList.length][1]),
double.parse(curStopList[index % curStopList.length][2]));
},
),
);
},
);
}