node function
A shorthand util that constructs either a GzChunk node
or a GzNode based on whether or not children are provided.
Implementation
GzBaseNode node(
String id, {
List<GzBaseNode>? children,
String? label,
String? color,
String? fontColor,
String? shape,
}) => switch (children) {
final List<GzBaseNode> ls => GzChunk(
id: id,
children: ls,
label: label,
color: color,
fontColor: fontColor,
shape: shape,
),
null => GzNode(
id: id,
label: label,
color: color,
fontColor: fontColor,
shape: shape,
),
};