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,31 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../../connect_api.dart';
|
||||
import '../rmv_models.dart';
|
||||
import '_query_format.dart';
|
||||
|
||||
class SearchTrips extends ConnectApi<TripSearchResult> {
|
||||
final String fromStopId;
|
||||
final String toStopId;
|
||||
final DateTime? when;
|
||||
final bool searchByArrival;
|
||||
|
||||
SearchTrips({
|
||||
required this.fromStopId,
|
||||
required this.toStopId,
|
||||
this.when,
|
||||
this.searchByArrival = false,
|
||||
}) : super('rmv/trips');
|
||||
|
||||
@override
|
||||
Map<String, String>? get queryParameters => {
|
||||
'from': fromStopId,
|
||||
'to': toStopId,
|
||||
if (when != null) 'when': formatLocalDateTime(when!),
|
||||
'searchByArrival': searchByArrival.toString(),
|
||||
};
|
||||
|
||||
@override
|
||||
TripSearchResult assemble(String raw) =>
|
||||
TripSearchResult.fromJson(jsonDecode(raw) as Map<String, dynamic>);
|
||||
}
|
||||
Reference in New Issue
Block a user