operator [] method

dynamic operator [](
  1. dynamic header
)

Gets value for header from the current record. If header is an int, it is interpreted as the column index. If header is a String, it is used to lookup the header and find the column index.

Implementation

dynamic operator [](dynamic header) {
  if (header is int) {
    return _data.get('', header);
  } else if (header is String) {
    return _data.get(header, -1);
  } else {
    throw InvalidHeaderException('Invalid header type ${header.runtimeType}: extected int or String');
  }
}