getBandInstrumentMatches static method

List<Instrument> getBandInstrumentMatches(
  1. Band band,
  2. Map<String, Instrument> profileInstruments
)

Implementation

static List<Instrument> getBandInstrumentMatches(Band band, Map<String,Instrument> profileInstruments) {

  List<Instrument> bandInstrumentMatches = [];

  try {
    for (var bandMember in band.members!.values) {
      if(profileInstruments.containsKey(bandMember.instrument!.id)
          && bandMember.profileId.isEmpty) {
        bandInstrumentMatches.add(profileInstruments[bandMember.instrument!.id] ?? Instrument());
      }
    }
  } catch (e) {
    AppConfig.logger.e(e.toString());
  }

  return bandInstrumentMatches;
}