matchBranch method

MessageBlockBranch? matchBranch(
  1. Map<String, dynamic>? variables
)

Implementation

MessageBlockBranch? matchBranch(Map<String, dynamic>? variables) {
  for (var branch in _branches) {
    if (branch.matches(variables)) {
      return branch;
    }
  }

  for (var branch in _branches) {
    if (branch._type == MessageBlockBranchType.defaultBranch) {
      return branch;
    }
  }

  for (var branch in _branches) {
    if (branch._type == MessageBlockBranchType.other) {
      return branch;
    }
  }

  return null;
}