addPointConnection method

void addPointConnection(
  1. PointConnection connection, {
  2. bool animateDraw = false,
  3. Duration animateDrawDuration = const Duration(seconds: 2),
})

Adds a connection between two points to the globe.

The connection parameter represents the connection to be added to the globe. The animateDraw parameter represents whether the connection should be animated when drawn. The animateDrawDuration parameter represents the duration of the animation when drawing the connection.

Example usage:

controller.addPointConnection(PointConnection(
  start: GlobeCoordinates(0, 0),
  end: GlobeCoordinates(0, 0),
  id: 'id',
  title: 'title',
  isTitleVisible: true,
  showTitleOnHover: true,
  isMoving: true),
  animateDraw: true,
 );

Implementation

void addPointConnection(PointConnection connection,
    {bool animateDraw = false,
    Duration animateDrawDuration = const Duration(seconds: 2)}) {
  final animatedConnection = AnimatedPointConnection.fromPointConnection(
      pointConnection: connection);
  connections.add(animatedConnection);
  notifyListeners();
  onPointConnectionAdded?.call(animatedConnection,
      animateDraw: animateDraw, animateDrawDuration: animateDrawDuration);
}