checkStartsWith function

dynamic checkStartsWith(
  1. dynamic logic,
  2. dynamic _myMap
)

Implementation

checkStartsWith(logic, _myMap) {
  var _questionIdToCheck = logic['question_id'];
  if (_myMap[_questionIdToCheck] != null) {
    var answer = _myMap[_questionIdToCheck];
    if (logic['value'] != null) {
      if (answer.startsWith(logic['value'])) {
        return true;
      } else {
        return false;
      }
    } else {
      return false;
    }
  } else {
    return false;
  }
}