updatePoint method

void updatePoint(
  1. String id, {
  2. String? label,
  3. Widget? labelBuilder(
    1. BuildContext context,
    2. Point point,
    3. bool isHovering,
    4. bool isVisible,
    )?,
  4. bool? isLabelVisible,
  5. Offset? labelOffset,
  6. PointStyle? style,
  7. TextStyle? labelTextStyle,
  8. VoidCallback? onTap,
  9. VoidCallback? onHover,
})

Updates the point on the globe.

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

Example usage:

 controller.updatePoint('id',
 title: 'title',
textStyle: TextStyle(color: Colors.red),
isTitleVisible: true,
showTitleOnHover: true,
style: PointStyle(color: Colors.red),
);

Implementation

void updatePoint(
  String id, {
  String? label,
  Widget? Function(
          BuildContext context, Point point, bool isHovering, bool isVisible)?
      labelBuilder,
  bool? isLabelVisible,
  Offset? labelOffset,
  PointStyle? style,
  TextStyle? labelTextStyle,
  VoidCallback? onTap,
  VoidCallback? onHover,
}) {
  points.firstWhere((element) => element.id == id).copyWith(
      label: label,
      labelBuilder: labelBuilder,
      isLabelVisible: isLabelVisible,
      labelOffset: labelOffset,
      style: style,
      labelTextStyle: labelTextStyle,
      onTap: onTap,
      onHover: onHover);
  notifyListeners();
}