tripsByAgency method
- PTAgency agency
Filters the trips by agency and returns a list of trips that match the specified agency. The agency must be one of the agencies in the list of agencies. If the agency is not found, an empty list is returned.
Parameters
- IN agency The agency to filter by.
Returns
A list of PTTrip objects that match the specified agency, or an empty list if the agency is not found.
Implementation
List<PTTrip> tripsByAgency(PTAgency agency) =>
_trips.where((PTTrip trip) => trip.agency.id == agency.id).toList();