duplicateTargetIds property

Set<String> get duplicateTargetIds

Target ids referenced by more than one step — a tour-authoring error (one tour at a time, a duplicated target is ambiguous). Counts HintStep.targetIds (extras included); repeating an id WITHIN one step is not a duplicate (the same hole twice is harmless). The check is cheap and lazy; used by the controller's start-validation.

Implementation

Set<String> get duplicateTargetIds {
  final seen = <String>{};
  final duplicates = <String>{};
  for (final step in steps) {
    for (final id in step.targetIds.toSet()) {
      if (!seen.add(id)) {
        duplicates.add(id);
      }
    }
  }
  return duplicates;
}