debugDisableShadows top-level property

bool debugDisableShadows
getter/setter pair

Whether to replace all shadows with solid color blocks.

This is useful when writing golden file tests (see matchesGoldenFile) since the rendering of shadows is not guaranteed to be pixel-for-pixel identical from version to version (or even from run to run).

This is set to true in AutomatedTestWidgetsFlutterBinding. Tests will fail if they change this value and do not reset it before the end of the test.

When this is set, BoxShadow.toPaint acts as if the BoxShadow.blurStyle was BlurStyle.normal regardless of the actual specified blur style. This is compensated for in BoxDecoration and ShapeDecoration but may need to be explicitly considered in other situations.

This property should not be changed during a frame (e.g. during a call to ShapeBorder.paintInterior or ShapeBorder.getOuterPath); doing so may cause undefined effects.

Implementation

bool debugDisableShadows = false;