getInt method

int getInt(
  1. int i
)

Returns the integer value of the field at index i. If the field is not a valid integer value will return -1.

Implementation

int getInt(int i) {
  final field = getField(i);
  final value = int.tryParse(field);
  if (value == null) {
    error = 'invalid integer value: $field';
    return -1;
  }
  return value;
}