updatePointConnection method

void updatePointConnection(
  1. String id, {
  2. String? label,
  3. Widget? labelBuilder(
    1. BuildContext context,
    2. PointConnection pointConnection,
    3. bool isHovering,
    4. bool isVisible,
    )?,
  4. bool? isLabelVisible,
  5. Offset? labelOffset,
  6. bool? isMoving,
  7. PointConnectionStyle? style,
  8. TextStyle? labelTextStyle,
  9. VoidCallback? onTap,
  10. VoidCallback? onHover,
})

Updates the connection between two points on the globe.

The id parameter represents the id of the connection to be updated. The label parameter represents the label of the connection. The labelBuilder parameter represents the builder of the label of the connection. The isLabelVisible parameter represents the visibility of the label of the connection. The labelOffset parameter represents the offset of the label from the connection line. The isMoving parameter represents whether the connection is currently moving. The style parameter represents the style of the connection line. The labelTextStyle parameter represents the text style of the label. The onTap parameter is a callback function that is called when the connection is tapped. The onHover parameter is a callback function that is called when the connection is hovered over.

Example usage:

controller.updatePointConnection('id',
  title: 'title',
  textStyle: TextStyle(color: Colors.red),
  isTitleVisible: true,
  isMoving: true,
  style: PointConnectionStyle(color: Colors.red),
 );

Implementation

void updatePointConnection(
  String id, {
  String? label,
  Widget? Function(BuildContext context, PointConnection pointConnection,
          bool isHovering, bool isVisible)?
      labelBuilder,
  bool? isLabelVisible,
  Offset? labelOffset,
  bool? isMoving,
  PointConnectionStyle? style,
  TextStyle? labelTextStyle,
  VoidCallback? onTap,
  VoidCallback? onHover,
}) {
  connections.firstWhere((element) => element.id == id).copyWith(
      label: label,
      isMoving: isMoving,
      labelBuilder: labelBuilder,
      isLabelVisible: isLabelVisible,
      labelOffset: labelOffset,
      style: style,
      labelTextStyle: labelTextStyle,
      onTap: onTap,
      onHover: onHover);
  notifyListeners();
}