getChildren method

List<IndividualElement?> getChildren(
  1. Map<String, GedcomElement> elementsMap
)

Returns the children sorted by the birth year if available

Returns empty list if no children found

Implementation

List<IndividualElement?> getChildren(Map<String, GedcomElement> elementsMap) {
  final childrenElements = <IndividualElement?>[];
  final childrenIds =
      children.where((element) => element.tag == GEDCOM_TAG_CHILD).toList();
  for (final child in childrenIds) {
    childrenElements.add(elementsMap[child.value!] as IndividualElement?);
  }
  childrenElements.sort();
  return childrenElements;
}