Angle class abstract

The <angle> CSS data type represents an angle value expressed in degrees, gradians, radians, or turns. It is used by CSS functions like rotate() and in gradient angles.

Positive numbers represent clockwise angles; negative numbers represent counter-clockwise angles. Common units are deg, rad, and turn.

Examples (CSS): 90deg, 3.1416rad, 0.25turn.

Read more: MDN <angle>

Constructors

Angle.deg(double value)
Constructs an Angle in degrees (<number>deg).
const
factory
Angle.rad(double value)
Constructs an Angle in radians (<number>rad).
const
factory
Angle.turn(double value)
Constructs an Angle in turns (<number>turn). One full circle is 1turn.
const
factory
Angle.variable(String value)
Constructs an Angle from a CSS variable reference: var(--name).
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
The CSS text value for this angle (e.g. 90deg, 1.5708rad, 0.25turn).
no setter

Methods

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

Operators

operator +(Angle other) Angle
Adds two angles. If both angles use the same unit the result may be combined; otherwise a CSS calc() expression will be produced.
operator ==(Object other) bool
The equality operator.
inherited

Constants

zero → const Angle
A zero angle (0). Useful when no rotation is required.