GedcomElement class

Base GEDCOM element Each line in a GEDCOM file is an element with the format level [pointer] tag [value] where level and tag are required, and pointer and value are optional.

Elements are arranged hierarchically according to their level, and elements with a level of zero are at the top level.

Elements with a level greater than zero are children of their parent. A pointer has the format @pname@, where pname is any sequence of characters and numbers. The pointer identifies the object being pointed to, so that any pointer included as the value of any element points back to the original object.

For example, an element may have a FAMS tag whose value is @F1@, meaning that this element points to the family record in which the associated person is a spouse.

Likewise, an element with a tag of FAMC has a value that points to a family record in which the associated person is a child.

See a GEDCOM file for examples of tags and their values.

Tags available to an element are available in tags.dart

Implementers
Annotations
  • @immutable

Constructors

GedcomElement({required int level, required String tag, String? pointer, String? value, List<GedcomElement>? children, GedcomElement? parent, String? crlf = '\n'})
Constructor of the element
GedcomElement.fromJson(String source)
Creates element from JSON
factory
GedcomElement.fromMap(Map<String, dynamic>? map)
Creates element from map
factory

Properties

children List<GedcomElement>
Direct child elements of the element
no setter
crlf String?
Character used to delimit new lines
final
hashCode int
The hash code for this object.
no setteroverride
isMultiline bool
Indicates whether element consist of multiple lines
no setter
level int
Level of the element within the GEDCOM file
final
multiLineValue String?
Value of the element including concatenations or continuations
no setter
parent GedcomElement?
Parent element of the element
final
pointer String?
Pointer of the element withing the GEDCOM file
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
Tag of the element within the GEDCOM file
final
value String?
Value of the element within the GEDCOM file
final

Methods

addChildElement(GedcomElement element) GedcomElement
Returns new reference to the added element where this element is its parent
copyWith({int? level, String? pointer, String? tag, String? value, List<GedcomElement>? children, GedcomElement? parent, String? crlf}) GedcomElement
Returns copy of the element
newChildElement({String? tag, String pointer = '', String value = ''}) GedcomElement
Creates and returns a new child element of this element
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toGedcomString({bool recursive = false}) String
Formats this element and optionally all of its subelements to GEDCOM string
toJson() String
Returns JSON representation of the elmenet
toMap() Map<String, dynamic>
Returns map of the element
toString() String
A string representation of this object.
override

Operators

operator ==(Object o) bool
The equality operator.
override

Static Properties

empty GedcomElement
final