Point class

An immutable position in two-dimensional space.

This class is roughly compatible with dart:ui's Offset.

Annotations
  • @immutable

Constructors

Point(double x, double y)
Creates a point object with x,y coordinates.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x double
The offset along the x-axis of this point.
final
y double
The offset along the y-axis of this point.
final

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 *(double multiplicand) Point
Returns a point whose coordinates are the coordinates of the left-hand-side operand (a Point) multiplied by the scalar right-hand-side operand (a double).
operator +(Point other) Point
Returns a point whose coordinates are the coordinates of the left-hand-side operand (a Point) added to the right-hand-side coordinates (a Point).
operator /(double divisor) Point
Returns a point whose coordinates are the coordinates of the left-hand-side operand (a Point) divided by the scalar right-hand-side operand (a double).
operator ==(Object other) bool
The equality operator.
override

Static Methods

distance(Point a, Point b) double
The distance between points a and b.
lerp(Point a, Point b, double t) Point
Linearly interpolate between two points.

Constants

zero → const Point
The point at the origin of coordinate space.