Clef constructor

Clef({
  1. ClefType clefType = ClefType.treble,
  2. int? staffPosition,
  3. String? type,
})

Implementation

Clef({this.clefType = ClefType.treble, this.staffPosition, String? type}) {
  // Backward compatibility - se type for fornecido, converta para ClefType
  if (type != null) {
    switch (type) {
      case 'g':
        _clefType = ClefType.treble;
        break;
      case 'f':
        _clefType = ClefType.bass;
        break;
      case 'c':
        _clefType = ClefType.alto;
        break;
      default:
        _clefType = ClefType.treble;
    }
  } else {
    _clefType = clefType;
  }
}