matchesPreviousStepTriggerOptionValues method

bool matchesPreviousStepTriggerOptionValues(
  1. List? previousStepTriggerOptionValues,
  2. String completedDocKey,
  3. String? completedSelectedOptionId
)

Implementation

bool matchesPreviousStepTriggerOptionValues(
  List<dynamic>? previousStepTriggerOptionValues,
  String completedDocKey,
  String? completedSelectedOptionId,
) {
  if (previousStepTriggerOptionValues == null ||
      previousStepTriggerOptionValues.isEmpty) {
    return true;
  }

  final selectedId = completedSelectedOptionId ?? '';
  final trigger = '$completedDocKey::$selectedId';
  for (final item in previousStepTriggerOptionValues) {
    if (item is String && item == trigger) {
      return true;
    }
  }
  return false;
}