setPositionAnimated method

  1. @override
bool setPositionAnimated(
  1. LocationPoint point,
  2. double duration,
  3. AnimationType type
)
override

Method is used to move the center of the circle with the specified animation. point Metrics coordinates of the center LocationPoint. duration Animation duration in seconds. type Animation type AnimationType. Default: CENTER. Returns true if the operation is successful, false otherwise.

Example:

// Set circle position with animation
LocationPoint animatedPoint = LocationPoint(150.0, 250.0);
bool animatedSuccess = _circleMapObject!.setPositionAnimated(
 animatedPoint,
 2.0,
 AnimationType.LINEAR,
);
print(
 "Set circle position with animation to (${animatedPoint.x}, ${animatedPoint.y}): $animatedSuccess",
);

Implementation

@override
bool setPositionAnimated(LocationPoint point, double duration, AnimationType type) {
    final _setPositionAnimatedFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Uint8 Function(Pointer<Void>, Pointer<Void>, Float, Uint32),
        int Function(Pointer<Void>, Pointer<Void>, double, int)
      >('navigine_sdk_flutter_CircleMapObject_setPositionAnimated__Point_Duration_Type'));
    final _pointHandle = navigine_sdk_flutter_LocationPoint_ToFfi(point);
    final _durationHandle = navigine_sdk_flutter_double_ToFfi(duration);
    final _typeHandle = navigine_sdk_flutter_AnimationType_ToFfi(type);
    final _handle = this.handle;
    final __resultHandle = _setPositionAnimatedFfi(_handle, _pointHandle, _durationHandle, _typeHandle);
    navigine_sdk_flutter_LocationPoint_ReleaseFfiHandle(_pointHandle);
    navigine_sdk_flutter_double_ReleaseFfiHandle(_durationHandle);
    navigine_sdk_flutter_AnimationType_ReleaseFfiHandle(_typeHandle);
    final _result = navigine_sdk_flutter_bool_FromFfi(__resultHandle);
    navigine_sdk_flutter_bool_ReleaseFfiHandle(__resultHandle);
    return _result;
}