updatePointConnection method
- String id, {
- String? label,
- Widget? labelBuilder(
- BuildContext context,
- PointConnection pointConnection,
- bool isHovering,
- bool isVisible,
- bool? isLabelVisible,
- Offset? labelOffset,
- bool? isMoving,
- PointConnectionStyle? style,
- TextStyle? labelTextStyle,
- VoidCallback? onTap,
- 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();
}