setOffset method

  1. @override
bool setOffset(
  1. double width,
  2. double height
)
override

Method is used to specify an offset for the icon’s anchor on screen. width Horizontal offset in pixels. height Vertical offset in pixels. Returns true if the operation is successful, false otherwise.

Example:

// Set position offset
bool offsetSuccess = _iconMapObject!.setOffset(0.0, -16.0);
print("Set position offset to (0.0, -16.0) pixels: $offsetSuccess");

Implementation

@override
bool setOffset(double width, double height) {
    final _setOffsetFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Uint8 Function(Pointer<Void>, Float, Float),
        int Function(Pointer<Void>, double, double)
      >('navigine_sdk_flutter_IconMapObject_setOffset__Width_Height'));
    final _widthHandle = navigine_sdk_flutter_double_ToFfi(width);
    final _heightHandle = navigine_sdk_flutter_double_ToFfi(height);
    final _handle = this.handle;
    final __resultHandle = _setOffsetFfi(_handle, _widthHandle, _heightHandle);
    navigine_sdk_flutter_double_ReleaseFfiHandle(_widthHandle);
    navigine_sdk_flutter_double_ReleaseFfiHandle(_heightHandle);
    final _result = navigine_sdk_flutter_bool_FromFfi(__resultHandle);
    navigine_sdk_flutter_bool_ReleaseFfiHandle(__resultHandle);
    return _result;
}