getMainInstrument static method
Implementation
static String getMainInstrument(Map<String, Instrument> instruments){
if(instruments.isEmpty) return "";
Instrument mainInstrument = Instrument();
for (var element in instruments.values) {
if(element.isMain) mainInstrument = element;
}
return mainInstrument.name.isNotEmpty ? mainInstrument.name : instruments.values.first.name;
}