OffsetPair class

A container for a local and global Offset pair.

Usually, the global Offset is in the coordinate space of the screen after conversion to logical pixels and the local offset is the same Offset, but transformed to a local coordinate space.

Annotations

Constructors

OffsetPair({required Offset local, required Offset global})
Creates a OffsetPair combining a local and global Offset.
const
OffsetPair.fromEventDelta(PointerEvent event)
Creates a OffsetPair from PointerEvent.localDelta and PointerEvent.delta.
factory
OffsetPair.fromEventPosition(PointerEvent event)
Creates a OffsetPair from PointerEvent.localPosition and PointerEvent.position.
factory

Properties

global Offset
The Offset in the global coordinate space after conversion to logical pixels.
final
hashCode int
The hash code for this object.
no setterinherited
local Offset
The Offset in the local coordinate space.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator +(OffsetPair other) OffsetPair
Adds the other.global to global and other.local to local.
operator -(OffsetPair other) OffsetPair
Subtracts the other.global from global and other.local from local.
operator ==(Object other) bool
The equality operator.
inherited

Constants

zero → const OffsetPair
A OffsetPair where both Offsets are Offset.zero.