ElevationThemeData class

定义后代小部件的默认elevation

elevation是两个表面之间沿 z 轴的相对距离。

后代小部件使用 SpacingTheme.of(context) 获取当前的 ElevationThemeData 对象。 ElevationThemeData 的实例可以使用 ElevationThemeData.copyWith 进行自定义。

新增属性时需同时更新ElevationThemeData默认构造方法、copyWith方法、lerp方法

配置参考https://m3.material.io/styles/elevation/overview

Inheritance

Constructors

ElevationThemeData({double level0 = 0.0, double level1 = 1.0, double level2 = 3.0, double level3 = 6.0, double level4 = 8.0, double level5 = 12.0})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
level0 → double
final
level1 → double
final
level2 → double
final
level3 → double
final
level4 → double
final
level5 → double
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? level0, double? level1, double? level2, double? level3, double? level4, double? level5}) → ThemeExtension<ElevationThemeData>
Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.
override
lerp(covariant ThemeExtension<ElevationThemeData>? other, double t) → ThemeExtension<ElevationThemeData>
Linearly interpolate with another ThemeExtension object.
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