I have these three lists in my app, but I can return only one of them, how can I do that to the three of them?
class TaskList extends StatelessWidget {
TaskList(this._tasks, this._starTime, this._endTime, this._onClick);
final List<Task> _tasks;
final List<Task> _starTime;
final List<Task> _endTime;
final _onClick;
@override
Widget build(BuildContext context) {
return ListView(
children: _tasks.map((task)
{
return TaskItem(task,_starTime,_endTime,_onClick);
}
).toList());
}
}
ListView
only accept one List, so to do this you need to combine all the list likeOutput:
Now use
newList
insideListView
to renderList
Code: