CssValue class

A CSS length value, with a number and unit component, for use in CSS properties such as width, top, padding, etc.

Implemented types

Constructors

CssValue(num number, [String unit = 'px'])
Creates a new CssValue.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
number num
The number component of this CSS value.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unit String
The unit component of this CSS value.
final

Methods

compareTo(CssValue other) int
Returns the result of comparing this value's number to that of other.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the String representation of this value, which can be used as CSS style values.
override

Operators

operator %(num other) CssValue
Returns the remainder of dividing this value's number by other.
operator *(num other) CssValue
Returns the result of multiplying this value's number by other.
operator +(CssValue other) CssValue
Returns a new CssValue with the sum of the numbers of this value and other.
operator -(CssValue other) CssValue
Returns a new CssValue with the difference between the numbers of this value and other.
operator /(num other) CssValue
Returns the result of dividing this value's number by other.
operator <(CssValue other) bool
Returns whether this value's number is less than that of other.
operator <=(CssValue other) bool
Returns whether this value's number is less than or equal to that of other.
operator ==(dynamic other) bool
Returns whether this value's number and unit are equal to that of other.
override
operator >(CssValue other) bool
Returns whether this value's number is greater than that of other.
operator >=(CssValue other) bool
Returns whether this value's number is greater than or equal to that of other.
operator unary-() CssValue
Returns a new CssValue with this value's unit and the negation of this value's number.

Static Methods

parse(dynamic source, {CssValue? onError(dynamic value, dynamic error)?}) CssValue?
Parse source and return its CssValue representation.