checkForDuplicateFlags method

void checkForDuplicateFlags()

Implementation

void checkForDuplicateFlags() {
  final List<String> flagPaths =
      countries.map((country) => country.flagImagePath).toList();
  final Set<String> uniqueFlags = <String>{};

  for (var path in flagPaths) {
    if (!uniqueFlags.add(path)) {
      if (kDebugMode) {
        print('Duplicate flag found: $path');
      }
    }
  }
}