customLabels property

  1. @override
Map<Vector3, String>? get customLabels
override

Additional position-specific labels

Implementation

@override
Map<Vector3, String>? get customLabels {
  if (faceLabels == null && vertexLabels == null) return null;

  final Map<Vector3, String> labels = {};

  faceLabels?.forEach((face, label) {
    final pos = _getFaceCenter(face);
    if (pos != null) labels[pos] = label;
  });

  vertexLabels?.forEach((index, label) {
    final pos = _getVertexPosition(index);
    if (pos != null) labels[pos] = label;
  });

  return labels.isEmpty ? null : labels;
}