position property

GemPosition? get position

Returns the most recent raw position sample, or null if unavailable.

This getter performs a synchronous call to the underlying engine to retrieve the latest available GemPosition. If the internal operation reports an error the getter returns null.

Returns

Implementation

static GemPosition? get position {
  final OperationResult retVal = staticMethod(
    'PositionService',
    'getPosition',
    args: DataType.position.id,
  );

  final GemError gemApiError = GemErrorExtension.fromCode(
    retVal['gemApiError'],
  );

  if (gemApiError != GemError.success) {
    return null;
  }

  final dynamic result = retVal['result'];
  if (result != null) {
    return GemPositionImpl.fromJson(result);
  }
  return null;
}