hasConflicts static method
Check for conflicts in a list of skills
Efficiently checks if any skills have duplicate names.
Args: skills: List of skills to check for conflicts
Returns: true if conflicts exist, false otherwise
Throws: ArgumentError: If skills list is null or contains null values
Implementation
static bool hasConflicts(List<Skill> skills) {
// In Dart's null safety, skills cannot be null and cannot contain null values
// All skills are guaranteed to be non-null by the type system
final names = <String>{};
for (final skill in skills) {
if (names.contains(skill.name)) {
return true;
}
names.add(skill.name);
}
return false;
}