debugAssertAllRenderVarsUnset function

bool debugAssertAllRenderVarsUnset(
  1. String reason, {
  2. 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.)

Implementation

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