updatePoint method
void
updatePoint(
- String id, {
- String? label,
- Widget? labelBuilder(
- BuildContext context,
- Point point,
- bool isHovering,
- bool isVisible,
- bool? isLabelVisible,
- Offset? labelOffset,
- PointStyle? style,
- TextStyle? labelTextStyle,
- VoidCallback? onTap,
- 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();
}