getByIndex<T> method

T? getByIndex<T>(
  1. int index
)

Get the value of the specified field index.

If the type of the requested return value is different from the type of this field defined, then an output conversion is performed. And if you specify a field index that is not defined, it throws an exception.

Implementation

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