Skip to content

Commit

Permalink
Change List
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Diniz committed Dec 2, 2019
1 parent 739847e commit c319130
Showing 1 changed file with 18 additions and 31 deletions.
49 changes: 18 additions & 31 deletions lib/buslist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,25 @@ class _StockListState extends State<BusList> {
ListView _buildStockList(context, List<BusModel> stocks) {
return new ListView.builder(
itemCount: stocks.length,
itemBuilder: (context, index) {
var item=stocks[index];
if(index==0){
var listTile = ListTile(
title :new Text("Results"),
subtitle: Container(
child: Table( border: TableBorder.all(width: 0.0),
children: [
TableRow(children: [
TableCell(child: new Text(item.busName)),
TableCell(child: new Text(item.nextHour.toString())),
TableCell(child: new Text(item.waitTime.toString())),
])
]

)),
);
return listTile;
itemBuilder: (context, index) {
var item=stocks[index];
if(index==0){
return ListTile(
title :new Text("Results") ,

subtitle: new Text(item.busName + '\t\t' + item.nextHour.toString()+ '\t\t' + item.waitTime.toString()),


);
}
else{
return Container(
child: Table( border: TableBorder.all(width: 0.0),
children: [
TableRow(children: [
TableCell(child: new Text(item.busName)),
TableCell(child: new Text(item.nextHour.toString())),
TableCell(child: new Text(item.waitTime.toString())),
])
]

),
);
else {
return ListTile(

subtitle: new Text(item.busName + '\t\t' + item.nextHour.toString()+ '\t\t' + item.waitTime.toString()),


);

}
},
);
Expand Down

0 comments on commit c319130

Please sign in to comment.