implemented RMV public transit module including trip search, station departures, and nearby stop lookup, added "Marianum Connect" API integration with bearer token authentication and auto-refresh logic, integrated geolocator for location-based station search, added persistent storage for favorite stations and recent trip queries, and implemented comprehensive UI for journey details, trip results, and disruption alerts
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../../connect_api.dart';
|
||||
import '../rmv_models.dart';
|
||||
import '_query_format.dart';
|
||||
|
||||
class GetDepartures extends ConnectApi<List<Departure>> {
|
||||
final String stopId;
|
||||
final DateTime? when;
|
||||
final int durationMinutes;
|
||||
final int maxJourneys;
|
||||
|
||||
GetDepartures({
|
||||
required this.stopId,
|
||||
this.when,
|
||||
this.durationMinutes = 60,
|
||||
this.maxJourneys = -1,
|
||||
}) : super('rmv/departures');
|
||||
|
||||
@override
|
||||
Map<String, String>? get queryParameters => {
|
||||
'stopId': stopId,
|
||||
if (when != null) 'when': formatLocalDateTime(when!),
|
||||
'duration': durationMinutes.toString(),
|
||||
'max': maxJourneys.toString(),
|
||||
};
|
||||
|
||||
@override
|
||||
List<Departure> assemble(String raw) => (jsonDecode(raw) as List)
|
||||
.map((e) => Departure.fromJson(e as Map<String, dynamic>))
|
||||
.toList(growable: false);
|
||||
}
|
||||
Reference in New Issue
Block a user