chore(formatting): autoformats and adaptations

This commit is contained in:
fbachus
2026-06-06 01:22:36 +02:00
parent c581800298
commit 5fd3e8faad
2 changed files with 18 additions and 16 deletions
+8 -5
View File
@@ -73,6 +73,7 @@ class _MyHomePageState extends State<MyHomePage> {
_counter++; _counter++;
}); });
} }
// TODO :find a better way to show the list // TODO :find a better way to show the list
void show_result(Future<List<String>> future_id) async { void show_result(Future<List<String>> future_id) async {
var tmp = await future_id; var tmp = await future_id;
@@ -123,12 +124,14 @@ class _MyHomePageState extends State<MyHomePage> {
style: Theme.of(context).textTheme.headlineMedium, style: Theme.of(context).textTheme.headlineMedium,
), ),
Text('API key from ENV is $API_KEY'), Text('API key from ENV is $API_KEY'),
MaterialButton(onPressed: () { show_result(ApiHandler.findStations('S Biesdorf')); setState(() {}); }, MaterialButton(
child: Text( onPressed: () {
'Search for \'S Biesdorf\'' show_result(ApiHandler.findStations('S Biesdorf'));
setState(() {});
},
child: Text('Search for \'S Biesdorf\''),
), ),
), Text(id),
Text(id)
], ],
), ),
), ),
+7 -8
View File
@@ -8,7 +8,6 @@ class Route {
}); });
// from trip API request // from trip API request
factory Route.fromJson(Map<String, dynamic> json) => Route( factory Route.fromJson(Map<String, dynamic> json) => Route(
segments: json["LegList"]["Leg"].map((leg) => Segment.fromJson(leg)), segments: json["LegList"]["Leg"].map((leg) => Segment.fromJson(leg)),
duration: duration:
@@ -58,8 +57,9 @@ class Station {
id: json["id"] as String? ?? json["extId"] as String, id: json["id"] as String? ?? json["extId"] as String,
name: json["name"], name: json["name"],
transportLines: json.containsKey("productAtStop") transportLines: json.containsKey("productAtStop")
? json["productAtStop"].map((jsonLine) => ? json["productAtStop"].map(
Line.fromJson(jsonLine as Map<String, dynamic>)) (jsonLine) => Line.fromJson(jsonLine as Map<String, dynamic>),
)
: const [], : const [],
); );
} }
@@ -126,7 +126,7 @@ class Departure {
Departure({ Departure({
required this.vehicle, required this.vehicle,
required this.station, required this.station,
required this.departureTime required this.departureTime,
}); });
} }
@@ -138,22 +138,21 @@ class Color {
Color({ Color({
required this.r, required this.r,
required this.g, required this.g,
required this.b required this.b,
}); });
factory Color.fromJson(Map<String, dynamic> json) => Color( factory Color.fromJson(Map<String, dynamic> json) => Color(
r: json["r"], r: json["r"],
g: json["g"], g: json["g"],
b: json["b"] b: json["b"],
); );
} }
enum VehicleType { enum VehicleType {
bus, bus,
tram, tram,
metro, metro,
subway, subway,
regionalTrain, regionalTrain,
PLACEHOLDER PLACEHOLDER,
} }