CornerShapeSpec class
Specifies the CornerShapeValue for each corner of a rectangle,
mirroring CSS corner-shape shorthand.
// CSS: corner-shape: scoop;
CornerShapeSpec.all(CornerShapeValue.scoop)
// CSS: corner-shape: round scoop bevel notch;
CornerShapeSpec.only(
topLeft: CornerShapeValue.round,
topRight: CornerShapeValue.scoop,
bottomRight: CornerShapeValue.bevel,
bottomLeft: CornerShapeValue.notch,
)
// CSS shorthand with 2 values (top-left+bottom-right, top-right+bottom-left)
CornerShapeSpec.symmetric(
diagonal1: CornerShapeValue.round,
diagonal2: CornerShapeValue.scoop,
)
Constructors
- CornerShapeSpec.all(CornerShapeValue value)
-
Creates a CornerShapeSpec with the same value for all corners.
const
- CornerShapeSpec.horizontal({required CornerShapeValue left, required CornerShapeValue right})
-
Creates a CornerShapeSpec with different horizontal halves.
const
- CornerShapeSpec.only({CornerShapeValue topLeft = CornerShapeValue.round, CornerShapeValue topRight = CornerShapeValue.round, CornerShapeValue bottomRight = CornerShapeValue.round, CornerShapeValue bottomLeft = CornerShapeValue.round})
-
Creates a CornerShapeSpec with explicit values for each corner.
const
- CornerShapeSpec.symmetric({required CornerShapeValue diagonal1, required CornerShapeValue diagonal2})
-
Creates a CornerShapeSpec with symmetric diagonal values.
const
- CornerShapeSpec.vertical({required CornerShapeValue top, required CornerShapeValue bottom})
-
Creates a CornerShapeSpec with different vertical halves.
const
Properties
- bottomLeft → CornerShapeValue
-
The shape of the bottom-left corner.
final
- bottomRight → CornerShapeValue
-
The shape of the bottom-right corner.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topLeft → CornerShapeValue
-
The shape of the top-left corner.
final
- topRight → CornerShapeValue
-
The shape of the top-right corner.
final
Methods
-
copyWith(
{CornerShapeValue? topLeft, CornerShapeValue? topRight, CornerShapeValue? bottomRight, CornerShapeValue? bottomLeft}) → CornerShapeSpec - Returns a copy with the given fields replaced.
-
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(
CornerShapeSpec a, CornerShapeSpec b, double t) → CornerShapeSpec - Linearly interpolates between two CornerShapeSpecs.
Constants
- bevel → const CornerShapeSpec
- All corners are beveled.
- notch → const CornerShapeSpec
- All corners are notched.
- round → const CornerShapeSpec
- All corners are standard round.
- scoop → const CornerShapeSpec
- All corners are scooped (concave).
- square → const CornerShapeSpec
- All corners are square (no rounding).
- squircle → const CornerShapeSpec
- All corners are squircle (iOS-style).