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,73 @@
|
||||
import '../../../../../api/connect/rmv/queries/get_arrivals.dart';
|
||||
import '../../../../../api/connect/rmv/queries/get_departures.dart';
|
||||
import '../../../../../api/connect/rmv/queries/get_disruptions.dart';
|
||||
import '../../../../../api/connect/rmv/queries/get_journey_detail.dart';
|
||||
import '../../../../../api/connect/rmv/queries/more_trips.dart';
|
||||
import '../../../../../api/connect/rmv/queries/nearby_stops.dart';
|
||||
import '../../../../../api/connect/rmv/queries/search_stops.dart';
|
||||
import '../../../../../api/connect/rmv/queries/search_trips.dart';
|
||||
import '../../../../../api/connect/rmv/rmv_models.dart';
|
||||
import '../../../infrastructure/repository/repository.dart';
|
||||
import '../bloc/rmv_state.dart';
|
||||
|
||||
class RmvRepository extends Repository<RmvState> {
|
||||
Future<List<StopLocation>> searchStops(String query, {int max = 10}) =>
|
||||
SearchStops(query: query, max: max).run();
|
||||
|
||||
Future<List<StopLocation>> nearbyStops({
|
||||
required double lat,
|
||||
required double lon,
|
||||
int radiusMeters = 1000,
|
||||
int max = 20,
|
||||
}) => NearbyStops(
|
||||
lat: lat,
|
||||
lon: lon,
|
||||
radiusMeters: radiusMeters,
|
||||
max: max,
|
||||
).run();
|
||||
|
||||
Future<List<Departure>> departures(
|
||||
String stopId, {
|
||||
DateTime? when,
|
||||
int durationMinutes = 60,
|
||||
int maxJourneys = -1,
|
||||
}) => GetDepartures(
|
||||
stopId: stopId,
|
||||
when: when,
|
||||
durationMinutes: durationMinutes,
|
||||
maxJourneys: maxJourneys,
|
||||
).run();
|
||||
|
||||
Future<List<Arrival>> arrivals(
|
||||
String stopId, {
|
||||
DateTime? when,
|
||||
int durationMinutes = 60,
|
||||
int maxJourneys = -1,
|
||||
}) => GetArrivals(
|
||||
stopId: stopId,
|
||||
when: when,
|
||||
durationMinutes: durationMinutes,
|
||||
maxJourneys: maxJourneys,
|
||||
).run();
|
||||
|
||||
Future<TripSearchResult> searchTrips({
|
||||
required String fromStopId,
|
||||
required String toStopId,
|
||||
DateTime? when,
|
||||
bool searchByArrival = false,
|
||||
}) => SearchTrips(
|
||||
fromStopId: fromStopId,
|
||||
toStopId: toStopId,
|
||||
when: when,
|
||||
searchByArrival: searchByArrival,
|
||||
).run();
|
||||
|
||||
Future<TripSearchResult> moreTrips(String ctx) =>
|
||||
MoreTrips(ctx: ctx).run();
|
||||
|
||||
Future<JourneyDetail> journeyDetail(String ref, {DateTime? date}) =>
|
||||
GetJourneyDetail(journeyRef: ref, date: date).run();
|
||||
|
||||
Future<List<HimMessage>> disruptions({DateTime? when}) =>
|
||||
GetDisruptions(when: when).run();
|
||||
}
|
||||
Reference in New Issue
Block a user