GenogramController<E> class
Controller responsible for managing and laying out genogram (family tree) charts
A genogram is a visual representation of a family tree that displays detailed data on relationships and medical history across generations. This controller handles:
- Node positioning and layout algorithms
- Parent-child relationship tracking
- Spouse relationship management
- Gender-based node positioning
- Multi-generational hierarchy visualization
- Inheritance
-
- Object
- BaseGraphController<
E> - GenogramController
Constructors
-
GenogramController({required List<
E> items, Size boxSize = GenogramConstants.defaultBoxSize, double spacing = GenogramConstants.defaultSpacing, double runSpacing = GenogramConstants.defaultRunSpacing, GraphOrientation orientation = GraphOrientation.topToBottom, required String idProvider(E data), required String? fatherProvider(E data), required String? motherProvider(E data), required List<String> ? spousesProvider(E data), required int genderProvider(E data)}) - Creates a genogram controller with the specified parameters
Properties
- boxSize ↔ Size
-
getter/setter pairinherited
- centerGraph ↔ void Function()?
-
getter/setter pairinherited
- fatherProvider ↔ String? Function(E data)
-
Function to extract the father's ID from an item
Returns null if the item has no father (root node)
getter/setter pair
- genderProvider ↔ int Function(E data)
-
Function to determine the gender of an item
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- idProvider ↔ String Function(E data)
-
getter/setter pairinherited
-
items
→ List<
E> -
no setterinherited
- motherProvider ↔ String? Function(E data)
-
Function to extract the mother's ID from an item
Returns null if the item has no mother (root node)
getter/setter pair
-
nodes
→ List<
Node< E> > -
no setterinherited
- orientation ↔ GraphOrientation
-
getter/setter pairinherited
-
repaintBoundaryKey
↔ GlobalKey<
State< StatefulWidget> > -
getter/setter pairinherited
-
roots
→ List<
Node< E> > -
Identifies the root nodes of the genogram
no setteroverride
- runSpacing ↔ double
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setState ↔ void Function(void function())?
-
getter/setter pairinherited
- spacing ↔ double
-
getter/setter pairinherited
-
spousesProvider
↔ List<
String> ? Function(E data) -
Function to extract a list of spouse IDs from an item
Returns an empty list if the item has no spouses
getter/setter pair
- uniqueNodeId → String
-
no setterinherited
- viewerController ↔ CustomInteractiveViewerController?
-
getter/setter pairinherited
Methods
-
addItem(
E item, {bool recalculatePosition = true, bool centerGraph = false}) → void -
Adds a single item to the chart
If an item with the same ID already exists, it will be replaced
recalculatePositiondetermines if the position is to be recalculated directly after adding you might want to add an item but not recalculate the position immediatelycenterGraphwether to center the chart after adding the item - if recalculatePosition is trueinherited -
addItems(
List< E> items, {bool recalculatePosition = true, bool centerGraph = false}) → void -
Adds multiple items to the chart
Items with existing IDs will replace the old ones
inherited
-
calculatePosition(
{bool center = true}) → void -
Calculates the positions of all nodes in the genogram
override
-
centerNode(
String nodeId, {double? scale, bool animate = true, Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeInOut}) → Future< void> -
Centers a specific node in the view
inherited
-
changeNodeIndex(
Node< E> node, int index) → void -
inherited
-
clearItems(
{bool recalculatePosition = true, bool centerGraph = false}) → void -
Removes all items from the chart
inherited
-
exportAsImage(
) → Future< Uint8List?> -
inherited
-
exportAsPdf(
) → Future< Document?> -
inherited
-
getChildren(
List< Node< nodes) → List<E> >Node< E> > - Retrieves all children nodes for a given list of parent nodes
-
getLevel(
Node< E> node) → int - Returns the generation level (depth) of a node in the genogram
-
getOverlapping(
Node< E> node) → List<Node< E> > -
inherited
-
getParents(
Node< E> node) → List<Node< E> > - Retrieves the parent nodes for a given child node
-
getSize(
{Size size = const Size(0, 0)}) → Size -
Clears all caches when items change
override
-
getSpouseList(
E data) → List< Node< E> > - Retrieves all spouse nodes for a given data item
-
isFemale(
E data) → bool - Convenience method to check if a data item represents a female Returns true if the gender code is 1
-
isMale(
E data) → bool - Convenience method to check if a data item represents a male Returns true if the gender code is 0
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceAll(
List< E> items, {bool recalculatePosition = true, bool centerGraph = false}) → void -
Replaces all items in the chart with new items
This is more efficient than clearing and adding items separately
override
-
setViewerController(
CustomInteractiveViewerController controller) → void -
Sets the interactive viewer controller for node centering
inherited
-
sortChildrenBySiblingGroups(
List< Node< children, List<E> >Node< coupleGroup) → voidE> > - Sorts children by sibling groups to keep children of the same parents together
-
switchOrientation(
{GraphOrientation? orientation, bool center = true}) → void -
Switch the orientation of the chart
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited