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.

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
local Offset
The Offset in the local coordinate space.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

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 ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

zero → const OffsetPair
A OffsetPair where both Offsets are Offset.zero.
const OffsetPair(local: Offset.zero, global: Offset.zero)