tripsByAgency method

List<PTTrip> tripsByAgency(
  1. PTAgency agency
)

Filters the trips by agency. Returns a list of trips that match the specified agency.

Parameter:

  • agency: The agency to filter by.

Returns: A list of PTTrip objects that match the specified agency.

Note: The agency must be one of the agencies in the list of agencies. If the agency is not found, an empty list is returned.

Implementation

List<PTTrip> tripsByAgency(PTAgency agency) =>
    _trips.where((trip) => trip.agency.id == agency.id).toList();