customMethod method

Future<void> customMethod(
  1. Map<String, dynamic> params
)

Implementation

Future<void> customMethod(final Map<String, dynamic> params) async {
  final rootElement = WidgetsBinding.instance.rootElement;

  if (rootElement == null) {
    print('No root element found');
    return;
  }

  final delegate = InspectorSerializationDelegate(
    service: WidgetInspectorService.instance,
  );
  CustomInspector().inspect(rootElement);

  final rootWidgetNode = rootElement.toDiagnosticsNode(
    name: 'rootWidget',
    style: DiagnosticsTreeStyle.sparse,
  );
  final rootWidgetJson = rootWidgetNode.toJsonMapIterative(delegate);
  print('Root widget info with limited children: $rootWidgetJson');
}