debugAssertAllRenderVarsUnset function

bool debugAssertAllRenderVarsUnset (String reason, { bool debugCheckIntrinsicSizesOverride: false })

Returns true if none of the rendering library debug variables have been changed.

This function is used by the test framework to ensure that debug variables haven't been inadvertently changed.

See the rendering library for a complete list.

The debugCheckIntrinsicSizesOverride argument can be provided to override the expected value for debugCheckIntrinsicSizes. (This exists because the test framework itself overrides this value in some cases.)


bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSizesOverride = false }) {
  assert(() {
    if (debugPaintSizeEnabled ||
        debugPaintBaselinesEnabled ||
        debugPaintLayerBordersEnabled ||
        debugPaintPointersEnabled ||
        debugRepaintRainbowEnabled ||
        debugRepaintTextRainbowEnabled ||
        debugCurrentRepaintColor != _kDebugDefaultRepaintColor ||
        debugPrintMarkNeedsLayoutStacks ||
        debugPrintMarkNeedsPaintStacks ||
        debugPrintLayouts ||
        debugCheckIntrinsicSizes != debugCheckIntrinsicSizesOverride ||
        debugProfilePaintsEnabled ||
        debugOnProfilePaint != null) {
      throw FlutterError(reason);
    return true;
  return true;