findPropertyByName method

ModelProperty? findPropertyByName(
  1. String name
)

Implementation

ModelProperty? findPropertyByName(String name) {
  final found = properties
      .where((p) => p.name.toLowerCase() == name.toLowerCase())
      .toList();
  if (found.isEmpty) return null;
  if (found.length >= 2) {
    throw StateError(
        'ambiguous property name: $name; please specify a UID in its annotation');
  }
  return found[0];
}