validateByName method

List<String>? validateByName(
  1. String name
)

Validate the value of the specified field name.

It throw exceptions in the following cases.

  • If you specify a field name that is not defined.

Implementation

List<String>? validateByName(String name){
  FieldSchema? fs = _schema?.fieldMap[name];
  if(fs == null){
    throw Exception("The specified field does not exist. name=$name, schema=$_schema");
  }
  if(!_validated.containsKey(name)){
    return null;
  }
  List<String>? result = fs.validate(_dataSet, this, getByName(name));
  _validated[name] = result == null ? [] : result;
  return result;
}