validateByIndex method

List<String>? validateByIndex(
  1. int index
)

Validate the value of the specified field index.

It throw exceptions in the following cases.

  • If you specify a field index that is not defined.
  • If you specify a field that is a view.

Implementation

List<String>? validateByIndex(int index){
  if(index < 0 || _schema == null || index >= _schema!.length){
    throw Exception("The specified field does not exist. index=$index, schema=$_schema");
  }
  return validateByName(_schema!.fields[index].name);
}