elevation property Null safety

double? elevation

The z-coordinate at which to place this physical object.

The scene must be explicitly recomposited after this property is changed (as described at Layer).

In tests, the debugDisableShadows flag is set to true by default. Several widgets and render objects force all elevations to zero when this flag is set. For this reason, this property will often be set to zero in tests even if the layer should be raised. To verify the actual value, consider setting debugDisableShadows to false in your test.

Implementation

double? get elevation => _elevation;
void elevation=(double? value)

Implementation

set elevation(double? value) {
  if (value != _elevation) {
    _elevation = value;
    markNeedsAddToScene();
  }
}