matchesPreviousDocumentKey method
bool
matchesPreviousDocumentKey(
- String? previousDocumentKey,
- String completedDocKey,
- int? completedFlowStep
)
Implementation
bool matchesPreviousDocumentKey(
String? previousDocumentKey,
String completedDocKey,
int? completedFlowStep,
) {
if (previousDocumentKey == null) return false;
final stepTrigger = getFlowStepTrigger(previousDocumentKey);
if (stepTrigger != null) {
return completedFlowStep != null && completedFlowStep == stepTrigger;
}
if (previousDocumentKey == completedDocKey) {
return true;
}
// Allow shorthand 'id' matching for identity-like sets if needed.
if (previousDocumentKey == 'id') {
// Example identity set matching: treat some keys as identity docs.
const identitySet = {'id_card', 'passport', 'identity'};
return identitySet.contains(completedDocKey);
}
return false;
}