Skip to content

Commit

Permalink
Change statement form in getEachBusStopInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
rubuy-74 committed Nov 16, 2023
1 parent 59b75e0 commit 4921814
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions uni/lib/view/home/widgets/bus_stop_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,25 @@ class BusStopCard extends GenericCard {
BuildContext context,
Map<String, BusStopData> stopData,
) {
final rows = <Widget>[const LastUpdateTimeStamp<BusStopProvider>()];

stopData.forEach((stopCode, stopInfo) {
if (stopInfo.trips.isNotEmpty && stopInfo.favorited) {
rows.add(
Container(
return stopData.entries
.where(
(busStop) =>
busStop.value.trips.isNotEmpty && busStop.value.favorited,
)
.map(
(busStop) => Container(
padding: const EdgeInsets.only(top: 12),
child: BusStopRow(
stopCode: stopCode,
trips: stopInfo.trips,
stopCode: busStop.key,
trips: busStop.value.trips,
singleTrip: true,
),
),
);
}
});
return rows;
)
.toList()
..add(
<Widget>[const LastUpdateTimeStamp<BusStopProvider>()] as Container,
);
}

/// Returns the bus stop info if it has trips
Expand Down

0 comments on commit 4921814

Please sign in to comment.