setAngleAnimated method

  1. @override
bool setAngleAnimated(
  1. double angle,
  2. double duration,
  3. AnimationType type
)
override

Method is used to rotate the icon with the specified animation. angle Rotation angle in degrees. duration Animation duration in seconds. type Animation type AnimationType. Returns true if the operation is successful, false otherwise.

Example:

// Set icon rotation with animation
bool angleAnimatedSuccess = _iconMapObject!.setAngleAnimated(
 90.0,
 2.0,
 AnimationType.SINE,
);
print(
 "Set icon rotation with animation to 90 degrees: $angleAnimatedSuccess",
);

Implementation

@override
bool setAngleAnimated(double angle, double duration, AnimationType type) {
    final _setAngleAnimatedFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Uint8 Function(Pointer<Void>, Float, Float, Uint32),
        int Function(Pointer<Void>, double, double, int)
      >('navigine_sdk_flutter_IconMapObject_setAngleAnimated__Angle_Duration_Type'));
    final _angleHandle = navigine_sdk_flutter_double_ToFfi(angle);
    final _durationHandle = navigine_sdk_flutter_double_ToFfi(duration);
    final _typeHandle = navigine_sdk_flutter_AnimationType_ToFfi(type);
    final _handle = this.handle;
    final __resultHandle = _setAngleAnimatedFfi(_handle, _angleHandle, _durationHandle, _typeHandle);
    navigine_sdk_flutter_double_ReleaseFfiHandle(_angleHandle);
    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;
}