getPropertyIndex method

int getPropertyIndex(
  1. String property
)

Get the index of a property in this schema.

Implementation

int getPropertyIndex(String property) {
  for (var i = 0; i < properties.length; i++) {
    if (properties[i].name == property) {
      return i + 1;
    }
  }
  if (idName == property) {
    return 0;
  }
  throw ArgumentError('Property $property not found in schema $name');
}