movementOccurances method

List<MovementSearchResult> movementOccurances(
  1. String movementName
)

Fetch all occurrances of a Movement as queried by a fuzzy name match.

Implementation

List<MovementSearchResult> movementOccurances(String movementName) {
  List<MovementSearchResult> result = [];

  for (Session session in sessions) {
    session.movements
        .where(
            (m) => m.name.toLowerCase().contains(movementName.toLowerCase()))
        .forEach(
            (m) => result.add(MovementSearchResult(session.occurred, m)));
  }

  return result;
}