getNextStages method
Implementation
Set<String> getNextStages(
List<AuthenticationFlow> flows, List<String> completed) {
final nextStages = <String>{};
for (final flow in flows) {
// check the flow starts with the completed stages
if (flow.stages.length >= completed.length &&
flow.stages.take(completed.length).toSet().containsAll(completed)) {
final stages = flow.stages.skip(completed.length);
if (stages.isNotEmpty) nextStages.add(stages.first);
}
}
return nextStages;
}