CornerRadius class

A ThemeExtension that exposes the design system's corner radius scale.

Provides 18 named radius steps — radius_0 (0 dp, sharp) through radius_17 (80 dp, fully rounded) — registered in ThemeData.extensions for both light and dark themes.

Access via ThemeData using the ThemeExtras extension:

ClipRRect(
  borderRadius: BorderRadius.circular(context.theme.radius_4),
  child: child,
)

Do not instantiate this class directly in widget code. Always read it through Theme.of(context) (or context.theme) so that theme overrides and lerp animations are respected.

Inheritance

Constructors

CornerRadius({double radius_0 = 0, double radius_1 = 2, double radius_2 = 4, double radius_3 = 6, double radius_4 = 8, double radius_5 = 10, double radius_6 = 12, double radius_7 = 14, double radius_8 = 16, double radius_9 = 20, double radius_10 = 24, double radius_11 = 32, double radius_12 = 40, double radius_13 = 48, double radius_14 = 56, double radius_15 = 64, double radius_16 = 72, double radius_17 = 80})
Creates a corner radius scale with the given step values, in logical pixels.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
radius_0 double
0 logical pixels — sharp, unrounded corners.
final
radius_1 double
2 logical pixels.
final
radius_10 double
24 logical pixels.
final
radius_11 double
32 logical pixels.
final
radius_12 double
40 logical pixels.
final
radius_13 double
48 logical pixels.
final
radius_14 double
56 logical pixels.
final
radius_15 double
64 logical pixels.
final
radius_16 double
72 logical pixels.
final
radius_17 double
80 logical pixels — used for fully rounded pill shapes.
final
radius_2 double
4 logical pixels.
final
radius_3 double
6 logical pixels.
final
radius_4 double
8 logical pixels.
final
radius_5 double
10 logical pixels.
final
radius_6 double
12 logical pixels.
final
radius_7 double
14 logical pixels.
final
radius_8 double
16 logical pixels.
final
radius_9 double
20 logical pixels.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Object
The extension's type.
no setterinherited

Methods

copyWith({double? radius_0, double? radius_1, double? radius_2, double? radius_3, double? radius_4, double? radius_5, double? radius_6, double? radius_7, double? radius_8, double? radius_9, double? radius_10, double? radius_11, double? radius_12, double? radius_13, double? radius_14, double? radius_15, double? radius_16, double? radius_17}) CornerRadius
Creates a copy of this corner radius scale with the given steps replaced.
override
lerp(covariant ThemeExtension<CornerRadius>? other, double t) CornerRadius
Linearly interpolates between this scale and other by factor t.
override
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 ==(Object other) bool
The equality operator.
inherited