OnyxCueList.fromLine constructor

OnyxCueList.fromLine(
  1. Onyx parent,
  2. String line
)

parses an onyx cuelist description line

Implementation

OnyxCueList.fromLine(this.parent, String line) {
  var pattern = RegExp(r'(\d{5}) - (.*)');
  var match = pattern.firstMatch(line);
  if (match != null) {
    cueListNumber = int.tryParse(match.group(1)!) ?? 0;
    name = match.group(2)!;
  } else {
    throw FormatException('Bad CueList Line: $line');
  }
}