nextSourceAfter function

String? nextSourceAfter(
  1. String failed,
  2. List<String> candidates
)

The source after failed; null when exhausted or off-chain, so a hand-picked pipeline keeps its own error.

Implementation

String? nextSourceAfter(String failed, List<String> candidates) {
  final int index = candidates.indexOf(failed);
  if (index == -1 || index + 1 >= candidates.length) return null;
  return candidates[index + 1];
}