debugAssertAllWidgetVarsUnset function

bool debugAssertAllWidgetVarsUnset(
  1. String reason
)

Returns true if none of the widget 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 widgets library for a complete list.

Implementation

bool debugAssertAllWidgetVarsUnset(String reason) {
  assert(() {
    if (debugPrintRebuildDirtyWidgets ||
        debugPrintBuildScope ||
        debugPrintScheduleBuildForStacks ||
        debugPrintGlobalKeyedWidgetLifecycle ||
        debugProfileBuildsEnabled ||
        debugHighlightDeprecatedWidgets ||
        debugProfileBuildsEnabledUserWidgets) {
      throw FlutterError(reason);
    }
    return true;
  }());
  return true;
}