findRelationByName method

ModelRelation? findRelationByName(
  1. String name
)

Implementation

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