setViewportOffset method

void setViewportOffset(
  1. Offset offset, {
  2. bool animate = true,
  3. bool absolute = false,
  4. bool isHandled = false,
})

This method is used to set the offset of the viewport.

The 'animate' parameter is used to animate the transition to the new offset. The 'absolute' parameter is used to choose whether the offset is added to the the current offset or set as an absolute value. The 'isHandled' parameter is used to indicate whether

Implementation

void setViewportOffset(
  Offset offset, {
  bool animate = true,
  bool absolute = false,
  bool isHandled = false,
}) {
  eventBus.emit(
    ViewportOffsetEvent(
      id: const Uuid().v4(),
      absolute ? offset : _viewportOffset + offset,
      animate: animate,
      isHandled: isHandled,
    ),
  );
}