getWidgetDiagnostics method Null safety

Future<Map<String, Object?>> getWidgetDiagnostics(
  1. SerializableFinder finder,
  2. {int subtreeDepth = 0,
  3. bool includeProperties = true,
  4. Duration? timeout}
)

Returns a JSON map of the DiagnosticsNode that is associated with the Widget identified by finder.

The subtreeDepth argument controls how many layers of children will be included in the result. It defaults to zero, which means that no children of the Widget identified by finder will be part of the result.

The includeProperties argument controls whether properties of the DiagnosticsNodes will be included in the result. It defaults to true.

Widgets describe configuration for the rendering tree. Individual widgets may create multiple RenderObjects to actually layout and paint the desired configuration.

See also:

Implementation

Future<Map<String, Object?>> getWidgetDiagnostics(
  SerializableFinder finder, {
  int subtreeDepth = 0,
  bool includeProperties = true,
  Duration? timeout,
}) async {
  return sendCommand(GetDiagnosticsTree(
    finder,
    DiagnosticsType.widget,
    subtreeDepth: subtreeDepth,
    includeProperties: includeProperties,
    timeout: timeout,
  ));
}