labels property

  1. @JsonKey.new(includeFromJson: false, includeToJson: false)
List<ConnectionLabel> get labels

The list of all non-null labels displayed along the connection path.

This getter returns a list containing the non-null labels from startLabel, label, and endLabel in that order. This is used internally for rendering.

Implementation

@JsonKey(includeFromJson: false, includeToJson: false)
List<ConnectionLabel> get labels {
  final result = <ConnectionLabel>[];
  if (_startLabel.value != null) result.add(_startLabel.value!);
  if (_label.value != null) result.add(_label.value!);
  if (_endLabel.value != null) result.add(_endLabel.value!);
  return result;
}