enableTracing function

void enableTracing({
  1. bool logRebuilds = true,
  2. bool logHandlers = true,
  3. bool logHelperFunctions = true,
})

enable tracing for the current build function has to be called before any other watch_it functions in the same build function If both logRebuilds and logHandlers are true then both will be logged if you want to enable tracing for the complete subtree you can wrap the widget that you want to trace including its child widgets with WatchItSubTreeTraceControl

WatchItSubTreeTraceControl(
  logRebuilds: true,
  logHandlers: true,
  logHelperFunctions: true,
  child: ...
)

Implementation

void enableTracing({
  bool logRebuilds = true,
  bool logHandlers = true,
  bool logHelperFunctions = true,
}) {
  assert(_activeWatchItState != null,
      'enableTracing can only be called inside a build function within a WatchingWidget or a widget using the WatchItMixin');
  _activeWatchItState!.enableTracing(
    logHandlers: logHandlers,
    logRebuilds: logRebuilds,
    logHelperFunctions: logHelperFunctions,
  );
}