From 708a524abf1df46584661a4a8edd890b55835a40 Mon Sep 17 00:00:00 2001 From: fbachus Date: Wed, 29 Jul 2026 14:30:36 +0200 Subject: [PATCH] chore: fix some linter warnings --- lib/main.dart | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 102bd2c..20ddd7f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -140,9 +140,6 @@ class _ChooseStationPageState extends State { maxStations: 20, ); } - /* TODO: function to get stations along a vehicles route past current station, - * and run the correct function on switching to the screen - */ void findStationsByName( String name, { @@ -151,8 +148,8 @@ class _ChooseStationPageState extends State { stationList = await ApiHandler.findStations(name); } - void showResult(Future> future_id) async { - stationList = await future_id; + void showResult(Future> futureId) async { + stationList = await futureId; setState(() {}); } @@ -235,7 +232,6 @@ class ChooseDeparturePage extends StatefulWidget { class _ChooseDeparturePageState extends State { List departureList = []; - Departure? _selectedDeparture; void loadDepartures(Station startStation) async { departureList = await ApiHandler.departures(startStation.id); @@ -244,6 +240,7 @@ class _ChooseDeparturePageState extends State { @override initState() { + super.initState(); loadDepartures(widget.startStation); } @@ -300,7 +297,7 @@ class DepartureList extends StatelessWidget { final List departureList; final ValueChanged onTapped; - DepartureList({ + const DepartureList({ required this.departureList, required this.onTapped, }); @@ -348,6 +345,7 @@ class _ChooseArrivalPageState extends State { @override initState() { + super.initState(); loadArrivals(widget.departure.ref); } @@ -398,7 +396,7 @@ class _ChooseArrivalPageState extends State { Journey journey = await Journey.fromSegment(newSegment); journeyId = journey.id as int; } else { - Segment segment = await newSegment; + Segment segment = newSegment; Journey.dbAppendJourneySegment( widget.journeyId as int, segment.id as int, @@ -441,4 +439,4 @@ class ArrivalList extends StatelessWidget { ], ); } -} +} \ No newline at end of file