Point constructor

Point({
  1. required GlobeCoordinates coordinates,
  2. String? label,
  3. Widget? labelBuilder(
    1. BuildContext context,
    2. Point point,
    3. bool isHovering,
    4. bool isVisible,
    )?,
  4. bool isLabelVisible = false,
  5. Offset labelOffset = const Offset(0, 0),
  6. required String id,
  7. PointStyle style = const PointStyle(),
  8. TextStyle? labelTextStyle,
  9. VoidCallback? onTap,
  10. VoidCallback? onHover,
})

Creates a new instance of the Point class.

The coordinates parameter represents the coordinates of the point on the globe. The label parameter is the label text of the point. The labelBuilder parameter is a builder function that returns a widget to display as the label of the point. The isLabelVisible parameter determines whether the label is visible or not. The labelOffset parameter is the offset of the label from the point. The id parameter is the unique identifier of the point. The style parameter is the style of the point. The labelTextStyle parameter is 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:

  Point(
    coordinates: GlobeCoordinates(0, 0),
    label: 'Center of Globe',
    labelBuilder: (context, point, isHovering, isVisible) {
      return Text('This is the center');
    },
    isLabelVisible: true,
    labelOffset: Offset(0, 0),
    id: '0',
    style: PointStyle(),
    labelTextStyle: TextStyle(),
    onTap: () {
      print('Point tapped');
     },
    onHover: () {
     print('Point hovered over');
     },
  );

Implementation

Point({
  required this.coordinates,
  this.label,
  this.labelBuilder,
  this.isLabelVisible = false,
  this.labelOffset = const Offset(0, 0),
  required this.id,
  this.style = const PointStyle(),
  this.labelTextStyle,
  this.onTap,
  this.onHover,
});