CornerShapeValue class

A value representing the curvature of a corner, modeled after the CSS superellipse() function.

Positive values curve outward (1 = round, 2 = squircle, ∞ = square). Zero gives a straight bevel. Negative values curve inward (-1 = scoop, -∞ = notch).

// CSS:   corner-shape: superellipse(-1.5);
// Dart:  CornerShapeValue.superellipse(-1.5)

// CSS:   corner-shape: scoop;
// Dart:  CornerShapeValue.scoop

Constructors

CornerShapeValue.fromType(CornerShapeType type)
Creates a corner shape value from a CornerShapeType keyword.
CornerShapeValue.superellipse(double k)
Creates a corner shape value with the given superellipse exponent k.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isBevel bool
Whether this is a straight bevel (K == 0).
no setter
isConcave bool
Whether this corner has inward curvature (K < 0, finite).
no setter
isConvex bool
Whether this corner has outward curvature (K > 0, finite).
no setter
isNotch bool
Whether this is a notch corner (K == -∞).
no setter
isSquare bool
Whether this is a sharp square corner (K == +∞).
no setter
k double
The superellipse exponent K.
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 ==(Object other) bool
The equality operator.
override

Static Methods

lerp(CornerShapeValue a, CornerShapeValue b, double t) CornerShapeValue
Linearly interpolates between two CornerShapeValues.

Constants

bevel → const CornerShapeValue
Straight diagonal cut. K = 0.
notch → const CornerShapeValue
90° inward square cut. K = -∞.
round → const CornerShapeValue
Standard outward circular arc. K = 1.
scoop → const CornerShapeValue
Concave inward arc. K = -1.
square → const CornerShapeValue
No rounding at all. K = +∞.
squircle → const CornerShapeValue
Smooth iOS-style superellipse. K = 2.