feat(departures): make some adaptations to supp diff departure srces

with these adaptations to the api_handler and Departure.fromJson,
the fromJson-factory now works for responses from both /departureBoard
and /tripDetail

for /tripDetail a little json-copying is used, see
ApiHandler._expandDeparturesJson
This commit is contained in:
fbachus
2026-07-23 21:42:13 +02:00
parent 1780a43f30
commit 1c0616fa86
3 changed files with 48 additions and 9 deletions
+3 -3
View File
@@ -348,7 +348,7 @@ class _ChooseArrivalPageState extends State<ChooseArrivalPage> {
Expanded(
child: SizedBox(
height: 400,
child: DepartureList(
child: ArrivalList(
departureList: departureList,
onTapped: _handleArrivalTapped,
),
@@ -398,11 +398,11 @@ class ArrivalList extends StatelessWidget {
children: [
for (Departure departure in departureList)
ListTile(
title: Text(departure.stationId),
title: Text(departure.stationName),
subtitle: Text(departure.arrivalTime.toString()),
onTap: () => onTapped(departure),
),
],
);
}
}
}