ConditionalNavigationRule.fromJson constructor

ConditionalNavigationRule.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ConditionalNavigationRule.fromJson(Map<String, dynamic> json) {
  final inputValues = json['values'] as Map<String, dynamic>;
  return ConditionalNavigationRule(
    resultToStepIdentifierMapper: (input) {
      for (final MapEntry entry in inputValues.entries) {
        if (entry.key == input) {
          return StepIdentifier(id: entry.value);
        }
      }
      return null;
    },
  );
}