captureWidgetTree method

Future<Map<String, dynamic>> captureWidgetTree({
  1. bool silent = false,
})

Implementation

Future<Map<String, dynamic>> captureWidgetTree({bool silent = false}) async {
  if (!silent) print('\n📸 Capturing widget tree...');

  final response = await _vmService!.callServiceExtension(
    'ext.flutter.inspector.getRootWidgetTree',
    isolateId: _isolateId,
    args: {'groupName': 'dangi_doctor', 'isSummaryTree': 'true'},
  );

  final json = response.json ?? {};
  if (json.containsKey('result')) {
    return json['result'] as Map<String, dynamic>;
  }
  if (json.containsKey('value')) return json['value'] as Map<String, dynamic>;
  return json;
}