Point constructor
- required GlobeCoordinates coordinates,
- String? label,
- Widget? labelBuilder(
- BuildContext context,
- Point point,
- bool isHovering,
- bool isVisible,
- bool isLabelVisible = false,
- Offset labelOffset = const Offset(0, 0),
- required String id,
- PointStyle style = const PointStyle(),
- TextStyle? labelTextStyle,
- VoidCallback? onTap,
- 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,
});