Fretting constructor
Fretting({
- required FrettedInstrument instrument,
- required Chord chord,
- required Iterable<
FretPosition> positions,
Implementation
Fretting({
required this.instrument,
required this.chord,
required Iterable<FretPosition> positions,
}) : this.positions = List<FretPosition>.from(sortedBy(
positions,
(FretPosition pos) => pos.stringIndex,
reverse: true,
)) {
assert(positions.length ==
positions.map((position) => position.stringIndex).toSet().length);
}