isValidSeoEditorialWorkflowState function
Implementation
bool isValidSeoEditorialWorkflowState(SeoEditorialWorkflowState state) {
final history = state.history;
if (history.isEmpty ||
history.length > seoEditorialWorkflowMaxHistoryEntries ||
history.first != SeoEditorialWorkflowStage.draft ||
history.last != state.stage) {
return false;
}
for (var index = 1; index < history.length; index++) {
if (!_isSeoEditorialWorkflowEdge(history[index - 1], history[index])) {
return false;
}
}
return true;
}