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