chore: remove more unused code (#5949)
diff --git a/packages/devtools_app/lib/src/framework/notifications_view.dart b/packages/devtools_app/lib/src/framework/notifications_view.dart index e2b99fb..447ce55 100644 --- a/packages/devtools_app/lib/src/framework/notifications_view.dart +++ b/packages/devtools_app/lib/src/framework/notifications_view.dart
@@ -264,7 +264,6 @@ Flexible( child: _NotificationMessage( widget: widget, - context: context, ), ), _DismissAction( @@ -276,7 +275,6 @@ ) : _NotificationMessage( widget: widget, - context: context, ), const SizedBox(height: defaultSpacing), _NotificationActions(widget: widget), @@ -313,11 +311,9 @@ class _NotificationMessage extends StatelessWidget { const _NotificationMessage({ required this.widget, - required this.context, }); final _Notification widget; - final BuildContext context; @override Widget build(BuildContext context) {
diff --git a/packages/devtools_app/lib/src/screens/debugger/codeview.dart b/packages/devtools_app/lib/src/screens/debugger/codeview.dart index 8a917e8..ef5150d 100644 --- a/packages/devtools_app/lib/src/screens/debugger/codeview.dart +++ b/packages/devtools_app/lib/src/screens/debugger/codeview.dart
@@ -54,8 +54,6 @@ this.lineRange, this.initialPosition, this.onSelected, - this.enableFileExplorer = true, - this.enableSearch = true, this.enableHistory = true, }) : super(key: key); @@ -78,8 +76,6 @@ // the script's source in its entirety, with lines outside of the range being // rendered as if they have been greyed out. final LineRange? lineRange; - final bool enableFileExplorer; - final bool enableSearch; final bool enableHistory; final void Function(ScriptRef scriptRef, int line)? onSelected;
diff --git a/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart b/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart index 248f51d..3bea9e5 100644 --- a/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart +++ b/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart
@@ -59,10 +59,7 @@ _refreshRateLimiter = RateLimiter(refreshFramesPerSecond, refresh); inspectorTree.config = InspectorTreeConfig( - summaryTree: isSummaryTree, - treeType: treeType, onNodeAdded: _onNodeAdded, - onHover: highlightShowNode, onSelectionChange: selectionChanged, onExpand: _onExpand, onClientActiveChange: _onClientChange, @@ -499,10 +496,6 @@ details?.setSubtreeRoot(subtreeRoot, subtreeSelection); } - InspectorInstanceRef? getSubtreeRootValue() { - return subtreeRoot?.valueRef; - } - void setSubtreeRoot( RemoteDiagnosticsNode? node, RemoteDiagnosticsNode? selection,
diff --git a/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart b/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart index cf3ecfd..674d148 100644 --- a/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart +++ b/packages/devtools_app/lib/src/screens/inspector/inspector_tree_controller.dart
@@ -181,8 +181,6 @@ }); } - RemoteDiagnosticsNode? subtreeRoot; // Optional. - InspectorTreeNode? get selection => _selection; InspectorTreeNode? _selection;
diff --git a/packages/devtools_app/lib/src/screens/logging/logging_controller.dart b/packages/devtools_app/lib/src/screens/logging/logging_controller.dart index 63571ae..1ae5c2b 100644 --- a/packages/devtools_app/lib/src/screens/logging/logging_controller.dart +++ b/packages/devtools_app/lib/src/screens/logging/logging_controller.dart
@@ -16,7 +16,6 @@ import 'package:vm_service/vm_service.dart'; import '../../service/vm_service_wrapper.dart'; -import '../../shared/console/eval/inspector_tree.dart'; import '../../shared/diagnostics/diagnostics_node.dart'; import '../../shared/diagnostics/inspector_service.dart'; import '../../shared/globals.dart'; @@ -64,100 +63,6 @@ Future.value(fallback); } -class LoggingDetailsController { - LoggingDetailsController({ - required this.onShowInspector, - required this.onShowDetails, - required this.createLoggingTree, - }); - - static const JsonEncoder jsonEncoder = JsonEncoder.withIndent(' '); - - late LogData data; - - /// Callback to execute to show the inspector. - final VoidCallback onShowInspector; - - /// Callback to execute to show the data from the details tree in the view. - final OnShowDetails onShowDetails; - - /// Callback to create an inspectorTree for the logging view of the correct - /// type. - final CreateLoggingTree createLoggingTree; - - InspectorTreeController? tree; - - void setData(LogData data) { - this.data = data; - - tree = null; - - if (data.node != null) { - tree = createLoggingTree( - onSelectionChange: () { - final InspectorTreeNode node = tree!.selection!; - unawaited(tree!.maybePopulateChildren(node)); - - // TODO(jacobr): node.diagnostic.isDiagnosticableValue isn't quite - // right. - final diagnosticLocal = node.diagnostic!; - if (diagnosticLocal.isDiagnosticableValue) { - // TODO(jacobr): warn if the selection can't be set as the node is - // stale which is likely if this is an old log entry. - onShowInspector(); - unawaited(diagnosticLocal.setSelectionInspector(false)); - } - }, - ); - - final InspectorTreeNode root = tree!.setupInspectorTreeNode( - tree!.createNode(), - data.node!, - expandChildren: true, - expandProperties: true, - ); - // No sense in collapsing the root node. - root.allowExpandCollapse = false; - tree!.root = root; - onShowDetails(tree: tree); - - return; - } - - // See if we need to asynchronously compute the log entry details. - if (data.needsComputing) { - onShowDetails(text: ''); - - unawaited( - data.compute().then((_) { - // If we're still displaying the same log entry, then update the UI with - // the calculated value. - if (this.data == data) { - _updateUIFromData(); - } - }), - ); - } else { - _updateUIFromData(); - } - } - - void _updateUIFromData() { - if (data.details?.startsWith('{') == true && - data.details?.endsWith('}') == true) { - try { - // If the string decodes properly, then format the json. - final result = jsonDecode(data.details!); - onShowDetails(text: jsonEncoder.convert(result)); - } catch (e) { - onShowDetails(text: data.details); - } - } else { - onShowDetails(text: data.details); - } - } -} - class LoggingController extends DisposableController with SearchControllerMixin<LogData>, @@ -822,22 +727,6 @@ } } - bool matchesFilter(String filter) { - if (kind.toLowerCase().contains(filter)) { - return true; - } - - if (summary != null && summary!.toLowerCase().contains(filter)) { - return true; - } - - if (_details != null && _details!.toLowerCase().contains(filter)) { - return true; - } - - return false; - } - @override bool matchesSearchToken(RegExp regExpSearch) { return (summary?.caseInsensitiveContains(regExpSearch) == true) || @@ -849,23 +738,19 @@ } class FrameInfo { - FrameInfo(this.number, this.elapsedMs, this.startTimeMs); + FrameInfo(this.number, this.elapsedMs); static const String eventName = 'Flutter.Frame'; - static const double kTargetMaxFrameTimeMs = 1000.0 / 60; - static FrameInfo from(Map<String, dynamic> data) { return FrameInfo( data['number'], data['elapsed'] / 1000, - data['startTime'] / 1000, ); } final int? number; final num? elapsedMs; - final num? startTimeMs; @override String toString() => 'frame $number ${elapsedMs!.toStringAsFixed(1)}ms';
diff --git a/packages/devtools_app/lib/src/screens/memory/framework/connected/memory_controller.dart b/packages/devtools_app/lib/src/screens/memory/framework/connected/memory_controller.dart index 6e1b31f..61a55e6 100644 --- a/packages/devtools_app/lib/src/screens/memory/framework/connected/memory_controller.dart +++ b/packages/devtools_app/lib/src/screens/memory/framework/connected/memory_controller.dart
@@ -112,19 +112,11 @@ final _refreshCharts = ValueNotifier<int>(0); - void refreshAllCharts() { - _refreshCharts.value++; - _updateAndroidChartVisibility(); - } - /// Default is to display default tick width based on width of chart of the collected /// data in the chart. final _displayIntervalNotifier = ValueNotifier<ChartInterval>(ChartInterval.theDefault); - ValueListenable<ChartInterval> get displayIntervalNotifier => - _displayIntervalNotifier; - set displayInterval(ChartInterval interval) { _displayIntervalNotifier.value = interval; }
diff --git a/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/diff_pane_controller.dart b/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/diff_pane_controller.dart index e5fe57a..b972b9b 100644 --- a/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/diff_pane_controller.dart +++ b/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/diff_pane_controller.dart
@@ -41,10 +41,6 @@ /// informational item. bool get hasSnapshots => core.snapshots.value.length > 1; - // This value should never be reset. It is incremented for every snapshot that - // is taken, and is used to assign a unique id to each [SnapshotListItem]. - int _snapshotId = 0; - Future<void> takeSnapshot() async { _isTakingSnapshot.value = true; ga.select( @@ -53,7 +49,6 @@ ); final item = SnapshotInstanceItem( - id: _snapshotId++, displayNumber: _nextDisplayNumber(), isolateName: selectedIsolateName ?? '<isolate-not-detected>', );
diff --git a/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/item_controller.dart b/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/item_controller.dart index eae709e..cd3ce39 100644 --- a/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/item_controller.dart +++ b/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/item_controller.dart
@@ -33,13 +33,10 @@ SnapshotInstanceItem({ required this.displayNumber, required this.isolateName, - required this.id, }) { _isProcessing.value = true; } - final int id; - final String isolateName; AdaptedHeap? heap;
diff --git a/packages/devtools_app/lib/src/screens/memory/panes/leaks/controller.dart b/packages/devtools_app/lib/src/screens/memory/panes/leaks/controller.dart index 1f8f8c7..2a95431 100644 --- a/packages/devtools_app/lib/src/screens/memory/panes/leaks/controller.dart +++ b/packages/devtools_app/lib/src/screens/memory/panes/leaks/controller.dart
@@ -80,7 +80,7 @@ List<LeakReport> reports, ) async { final graph = (await snapshotMemoryInSelectedIsolate())!; - return NotGCedAnalyzerTask.fromSnapshot(graph, reports, selectedIsolateId!); + return NotGCedAnalyzerTask.fromSnapshot(graph, reports); } Future<void> requestLeaksAndSaveToYaml() async {
diff --git a/packages/devtools_app/lib/src/screens/memory/panes/leaks/diagnostics/model.dart b/packages/devtools_app/lib/src/screens/memory/panes/leaks/diagnostics/model.dart index 3b1ec20..7e4b33a 100644 --- a/packages/devtools_app/lib/src/screens/memory/panes/leaks/diagnostics/model.dart +++ b/packages/devtools_app/lib/src/screens/memory/panes/leaks/diagnostics/model.dart
@@ -34,10 +34,9 @@ static Future<NotGCedAnalyzerTask> fromSnapshot( HeapSnapshotGraph graph, List<LeakReport> reports, - String isolateId, ) async { return NotGCedAnalyzerTask( - heap: await AdaptedHeapData.fromHeapSnapshot(graph, isolateId: isolateId), + heap: await AdaptedHeapData.fromHeapSnapshot(graph), reports: reports, ); }
diff --git a/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart b/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart index 3c75e7d..dc92b9e 100644 --- a/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart +++ b/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart
@@ -115,22 +115,18 @@ final snapshot = await snapshotMemoryInSelectedIsolate(); _timeline?.addSnapshotEvent(); if (snapshot == null) return null; - final result = - await _adaptSnapshotGaWrapper(snapshot, isolateId: selectedIsolateId!); + final result = await _adaptSnapshotGaWrapper(snapshot); return result; } } -Future<AdaptedHeapData> _adaptSnapshotGaWrapper( - HeapSnapshotGraph graph, { - required String isolateId, -}) async { +Future<AdaptedHeapData> _adaptSnapshotGaWrapper(HeapSnapshotGraph graph) async { late final AdaptedHeapData result; await ga.timeAsync( gac.memory, gac.MemoryTime.adaptSnapshot, - asyncOperation: () async => result = - await AdaptedHeapData.fromHeapSnapshot(graph, isolateId: isolateId), + asyncOperation: () async => + result = await AdaptedHeapData.fromHeapSnapshot(graph), screenMetricsProvider: () => MemoryScreenMetrics( heapObjectsTotal: graph.objects.length, ),
diff --git a/packages/devtools_app/lib/src/screens/memory/shared/primitives/memory_timeline.dart b/packages/devtools_app/lib/src/screens/memory/shared/primitives/memory_timeline.dart index 82b6ab3..02f17c3 100644 --- a/packages/devtools_app/lib/src/screens/memory/shared/primitives/memory_timeline.dart +++ b/packages/devtools_app/lib/src/screens/memory/shared/primitives/memory_timeline.dart
@@ -5,13 +5,10 @@ import 'package:devtools_shared/devtools_shared.dart'; import 'package:flutter/foundation.dart'; import 'package:intl/intl.dart'; -import 'package:logging/logging.dart'; import 'package:vm_service/vm_service.dart'; import '../../../../shared/primitives/utils.dart'; -final _log = Logger('memory_timeline'); - enum ContinuesState { none, start, @@ -21,36 +18,6 @@ /// All Raw data received from the VM and offline data loaded from a memory log file. class MemoryTimeline { - /// Version of timeline data (HeapSample) JSON payload. - static const version = 1; - - /// Keys used in a map to store all the MPChart Entries we construct to be plotted. - static const capacityValueKey = 'capacityValue'; - static const usedValueKey = 'usedValue'; - static const externalValueKey = 'externalValue'; - static const rssValueKey = 'rssValue'; - static const rasterLayerValueKey = 'rasterLayerValue'; - static const rasterPictureValueKey = 'rasterPictureValue'; - - /// Keys used in a map to store all the MPEngineChart Entries we construct to be plotted, - /// ADB memory info. - static const javaHeapValueKey = 'javaHeapValue'; - static const nativeHeapValueKey = 'nativeHeapValue'; - static const codeValueKey = 'codeValue'; - static const stackValueKey = 'stackValue'; - static const graphicsValueKey = 'graphicsValue'; - static const otherValueKey = 'otherValue'; - static const systemValueKey = 'systemValue'; - static const totalValueKey = 'totalValue'; - - static const gcUserEventKey = 'gcUserEvent'; - static const gcVmEventKey = 'gcVmEvent'; - static const snapshotEventKey = 'snapshotEvent'; - static const snapshotAutoEventKey = 'snapshotAutoEvent'; - static const monitorStartEventKey = 'monitorStartEvent'; - static const monitorContinuesEventKey = 'monitorContinuesEvent'; - static const monitorResetEventKey = 'monitorResetEvent'; - static const delayMs = 500; static const Duration updateDelay = Duration(milliseconds: delayMs); @@ -137,52 +104,6 @@ ); } - void addMonitorStartEvent() { - final timestamp = DateTime.now().millisecondsSinceEpoch; - postEventSample( - EventSample.accumulatorStart( - timestamp, - events: extensionEvents, - ), - ); - } - - void addMonitorResetEvent() { - final timestamp = DateTime.now().millisecondsSinceEpoch; - // TODO(terry): Enable to make continuous events visible? - // displayContinuousEvents(); - - postEventSample( - EventSample.accumulatorReset( - timestamp, - events: extensionEvents, - ), - ); - } - - void displayContinuousEvents() { - for (var index = liveData.length - 1; index >= 0; index--) { - final sample = liveData[index]; - if (sample.memoryEventInfo.isEventAllocationAccumulator) { - final allocationAccumulator = - sample.memoryEventInfo.allocationAccumulator!; - if (allocationAccumulator.isReset || allocationAccumulator.isStart) { - for (var flipIndex = index + 1; - flipIndex < liveData.length; - flipIndex++) { - final continuousEvent = liveData[flipIndex]; - assert( - continuousEvent - .memoryEventInfo.allocationAccumulator!.isContinues, - ); - continuousEvent - .memoryEventInfo.allocationAccumulator!.continuesVisible = true; - } - } - } - } - } - bool get anyEvents => peekEventTimestamp != -1; /// Peek at next event to pull, if no event return -1 timestamp. @@ -205,48 +126,11 @@ /// Whether the timeline has been manually paused via the Pause button. bool manuallyPaused = false; - /// Notifies that the timeline has been paused. - final _pausedNotifier = ValueNotifier<bool>(false); - - ValueNotifier<bool> get pausedNotifier => _pausedNotifier; - - void pause({bool manual = false}) { - manuallyPaused = manual; - _pausedNotifier.value = true; - } - - void resume() { - manuallyPaused = false; - _pausedNotifier.value = false; - } - - /// Notifies any visible marker for a particular chart should be hidden. - final _markerHiddenNotifier = ValueNotifier<bool>(false); - - ValueListenable<bool> get markerHiddenNotifier => _markerHiddenNotifier; - - void hideMarkers() { - _markerHiddenNotifier.value = !_markerHiddenNotifier.value; - } - void reset() { liveData.clear(); startingIndex = 0; } - /// Y-coordinate of an Event entry to not display (the no event state). - static const emptyEvent = -2.0; // Event (empty) to not visibly display. - - /// Event to display in the event pane (User initiated GC, snapshot, - /// automatic snapshot, etc.) - static const visibleEvent = 1.7; - - /// Monitor events Y axis. - static const visibleMonitorEvent = 0.85; - - /// VM's GCs are displayed in a smaller glyph and closer to the heap graph. - static const visibleVmEvent = 0.2; - /// Common utility function to handle loading of the data into the /// chart for either offline or live Feed. @@ -255,39 +139,6 @@ static String fineGrainTimestampFormat(int timestamp) => _milliFormat.format(DateTime.fromMillisecondsSinceEpoch(timestamp)); - void computeStartingIndex(int displayInterval) { - // Compute a new starting index from length - N minutes. - final timeLastSample = data.last.timestamp; - var dataIndex = data.length - 1; - for (; dataIndex > 0; dataIndex--) { - final sample = data[dataIndex]; - final timestamp = sample.timestamp; - - if ((timeLastSample - timestamp) > displayInterval) break; - } - - startingIndex = dataIndex; - - // Debugging data - to enable remove logical not operator. - // ignore: dead_code - if (!true) { - final DateFormat mFormat = DateFormat('HH:mm:ss.SSS'); - final startDT = mFormat.format( - DateTime.fromMillisecondsSinceEpoch( - data[startingIndex].timestamp.toInt(), - ), - ); - final endDT = mFormat.format( - DateTime.fromMillisecondsSinceEpoch( - data[endingIndex].timestamp.toInt(), - ), - ); - _log.info( - 'Recompute Time range Offline data start: $startDT, end: $endDT', - ); - } - } - void addSample(HeapSample sample) { // Always record the heap sample in the raw set of data (liveFeed). liveData.add(sample);
diff --git a/packages/devtools_app/lib/src/screens/network/network_controller.dart b/packages/devtools_app/lib/src/screens/network/network_controller.dart index 7ac856e..90b3243 100644 --- a/packages/devtools_app/lib/src/screens/network/network_controller.dart +++ b/packages/devtools_app/lib/src/screens/network/network_controller.dart
@@ -126,7 +126,6 @@ List<HttpProfileRequest>? httpRequests, int timelineMicrosOffset, { required CurrentNetworkRequests currentRequests, - required List<DartIOHttpRequestData> invalidRequests, }) { currentRequests.updateWebSocketRequests(sockets, timelineMicrosOffset); @@ -146,7 +145,6 @@ return NetworkRequests( requests: currentRequests.requests, - invalidHttpRequests: invalidRequests, ); } @@ -160,7 +158,6 @@ httpRequests, _timelineMicrosOffset, currentRequests: _currentNetworkRequests, - invalidRequests: [], ); _filterAndRefreshSearchMatches(); _updateSelection();
diff --git a/packages/devtools_app/lib/src/screens/network/network_model.dart b/packages/devtools_app/lib/src/screens/network/network_model.dart index 588aafd..5bdd668 100644 --- a/packages/devtools_app/lib/src/screens/network/network_model.dart +++ b/packages/devtools_app/lib/src/screens/network/network_model.dart
@@ -4,7 +4,6 @@ import 'package:vm_service/vm_service.dart'; -import '../../shared/http/http_request_data.dart'; import '../../shared/primitives/utils.dart'; import '../../shared/ui/search.dart'; @@ -185,21 +184,10 @@ class NetworkRequests { NetworkRequests({ this.requests = const [], - this.invalidHttpRequests = const [], }); /// A list of network requests. /// /// Individual requests in this list can be either completed or in-progress. List<NetworkRequest> requests; - - /// A list of invalid HTTP requests received. - /// - /// These are requests that have completed but do not contain all the required - /// information to display normally in the UI. - List<DartIOHttpRequestData> invalidHttpRequests; - - void clear() { - requests.clear(); - } }
diff --git a/packages/devtools_app/lib/src/screens/performance/panes/controls/enhance_tracing/enhance_tracing_model.dart b/packages/devtools_app/lib/src/screens/performance/panes/controls/enhance_tracing/enhance_tracing_model.dart index 6d7310a..3530302 100644 --- a/packages/devtools_app/lib/src/screens/performance/panes/controls/enhance_tracing/enhance_tracing_model.dart +++ b/packages/devtools_app/lib/src/screens/performance/panes/controls/enhance_tracing/enhance_tracing_model.dart
@@ -18,8 +18,6 @@ final bool layouts; final bool paints; - bool get enhanced => builds || layouts || paints; - bool enhancedFor(FramePhaseType type) { switch (type) { case FramePhaseType.build:
diff --git a/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart b/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart index 220cea0..bb55f54 100644 --- a/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart +++ b/packages/devtools_app/lib/src/screens/performance/panes/flutter_frames/flutter_frame_model.dart
@@ -128,13 +128,6 @@ event.frameId = id; } - TimelineEvent? findTimelineEvent(TimelineEvent event) { - final frameTimelineEvent = timelineEventData.eventByType(event.type); - return frameTimelineEvent?.firstChildWithCondition( - (e) => e.name == event.name && e.time == event.time, - ); - } - bool isJanky(double displayRefreshRate) { return isUiJanky(displayRefreshRate) || isRasterJanky(displayRefreshRate); }
diff --git a/packages/devtools_app/lib/src/screens/performance/performance_model.dart b/packages/devtools_app/lib/src/screens/performance/performance_model.dart index 83b68f8..601951f 100644 --- a/packages/devtools_app/lib/src/screens/performance/performance_model.dart +++ b/packages/devtools_app/lib/src/screens/performance/performance_model.dart
@@ -49,14 +49,10 @@ static const selectedEventKey = 'selectedEvent'; - static const timelineModeKey = 'timelineMode'; - static const uiKey = 'UI'; static const rasterKey = 'Raster'; - static const gcKey = 'GC'; - static const unknownKey = 'Unknown'; static const displayRefreshRateKey = 'displayRefreshRate'; @@ -126,10 +122,6 @@ _endTimestampMicros = math.max(_endTimestampMicros, event.maxEndMicros); } - bool hasCpuProfileData() { - return cpuProfileData != null && cpuProfileData!.stackFrames.isNotEmpty; - } - void clear() { traceEvents.clear(); selectedEvent = null; @@ -475,10 +467,6 @@ } static const firstTraceKey = 'firstTrace'; - static const eventNameKey = 'name'; - static const eventTypeKey = 'type'; - static const eventStartTimeKey = 'startMicros'; - static const eventDurationKey = 'durationMicros'; /// Trace events associated with this [TimelineEvent]. /// @@ -708,10 +696,6 @@ } } - void formatFromRoot(StringBuffer buf, String indent) { - root.format(buf, indent); - } - void writeTraceToBuffer(StringBuffer buf) { buf.writeln(beginTraceEventJson); for (TimelineEvent child in children) {
diff --git a/packages/devtools_app/lib/src/screens/profiler/cpu_profile_model.dart b/packages/devtools_app/lib/src/screens/profiler/cpu_profile_model.dart index 9c25f05..bf94f26 100644 --- a/packages/devtools_app/lib/src/screens/profiler/cpu_profile_model.dart +++ b/packages/devtools_app/lib/src/screens/profiler/cpu_profile_model.dart
@@ -356,14 +356,6 @@ } /// Generate a cpu profile from [originalData] where each sample contains the - /// vmTag [tag]. - /// - /// [originalData] does not need to be [processed] to run this operation. - factory CpuProfileData.fromVMTag(CpuProfileData originalData, String tag) { - return CpuProfileData._fromTag(originalData, tag, CpuProfilerTagType.vm); - } - - /// Generate a cpu profile from [originalData] where each sample contains the /// userTag [tag]. /// /// [originalData] does not need to be [processed] to run this operation.
diff --git a/packages/devtools_app/lib/src/screens/profiler/panes/controls/cpu_profiler_controls.dart b/packages/devtools_app/lib/src/screens/profiler/panes/controls/cpu_profiler_controls.dart index a2d02e3..04845a7 100644 --- a/packages/devtools_app/lib/src/screens/profiler/panes/controls/cpu_profiler_controls.dart +++ b/packages/devtools_app/lib/src/screens/profiler/panes/controls/cpu_profiler_controls.dart
@@ -34,14 +34,11 @@ '.toString -uri:flutter' '''; - double get _filterDialogWidth => scaleByFontFactor(400.0); - final CpuProfilerController controller; @override Widget build(BuildContext context) { return FilterDialog<CpuStackFrame>( - dialogWidth: _filterDialogWidth, controller: controller, queryInstructions: filterQueryInstructions, );
diff --git a/packages/devtools_app/lib/src/screens/profiler/panes/cpu_profile_columns.dart b/packages/devtools_app/lib/src/screens/profiler/panes/cpu_profile_columns.dart index ebe6b5d..a3fdd69 100644 --- a/packages/devtools_app/lib/src/screens/profiler/panes/cpu_profile_columns.dart +++ b/packages/devtools_app/lib/src/screens/profiler/panes/cpu_profile_columns.dart
@@ -71,7 +71,6 @@ methodName: data.name, packageUri: data.packageUri, sourceLine: data.sourceLine, - isSelected: isRowSelected, ); } }
diff --git a/packages/devtools_app/lib/src/screens/profiler/panes/method_table/method_table.dart b/packages/devtools_app/lib/src/screens/profiler/panes/method_table/method_table.dart index 92f7206..11179f5 100644 --- a/packages/devtools_app/lib/src/screens/profiler/panes/method_table/method_table.dart +++ b/packages/devtools_app/lib/src/screens/profiler/panes/method_table/method_table.dart
@@ -150,7 +150,6 @@ methodName: selectedNode.name, packageUri: selectedNode.packageUri, sourceLine: selectedNode.sourceLine, - isSelected: false, displayInRow: false, ), ), @@ -268,7 +267,6 @@ methodName: data.name, packageUri: data.packageUri, sourceLine: data.sourceLine, - isSelected: isRowSelected, ); } }
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/isolate_statistics/isolate_statistics_view.dart b/packages/devtools_app/lib/src/screens/vm_developer/isolate_statistics/isolate_statistics_view.dart index e042934..64cd814 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/isolate_statistics/isolate_statistics_view.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/isolate_statistics/isolate_statistics_view.dart
@@ -24,7 +24,6 @@ class IsolateStatisticsView extends VMDeveloperView { const IsolateStatisticsView() : super( - id, title: 'Isolates', icon: Icons.bar_chart, );
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view.dart b/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view.dart index 3e1fa21..54f1c92 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view.dart
@@ -25,7 +25,6 @@ class ObjectInspectorView extends VMDeveloperView { ObjectInspectorView() : super( - id, title: 'Objects', icon: Icons.data_object_outlined, );
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view_controller.dart b/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view_controller.dart index 1a9d238..cd5fa64 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view_controller.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/object_inspector_view_controller.dart
@@ -46,8 +46,6 @@ final objectHistory = ObjectHistory(); - Isolate? isolate; - ValueListenable<bool> get refreshing => _refreshing; final _refreshing = ValueNotifier<bool>(false);
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_common_widgets.dart b/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_common_widgets.dart index 3082399..1b7af2f 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_common_widgets.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_common_widgets.dart
@@ -1046,9 +1046,7 @@ codeViewController: widget.codeViewController, scriptRef: widget.script, parsedScript: currentParsedScript, - enableFileExplorer: false, enableHistory: false, - enableSearch: false, lineRange: lineRange, onSelected: breakpointManager.toggleBreakpoint, ),
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_tools_screen.dart b/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_tools_screen.dart index 7230b95..c080fb7 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_tools_screen.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/vm_developer_tools_screen.dart
@@ -15,14 +15,11 @@ import 'vm_statistics/vm_statistics_view.dart'; abstract class VMDeveloperView { - const VMDeveloperView( - this.screenId, { + const VMDeveloperView({ required this.title, required this.icon, }); - final String screenId; - /// The user-facing name of the page. final String title;
diff --git a/packages/devtools_app/lib/src/screens/vm_developer/vm_statistics/vm_statistics_view.dart b/packages/devtools_app/lib/src/screens/vm_developer/vm_statistics/vm_statistics_view.dart index 37dfec5..adf9328 100644 --- a/packages/devtools_app/lib/src/screens/vm_developer/vm_statistics/vm_statistics_view.dart +++ b/packages/devtools_app/lib/src/screens/vm_developer/vm_statistics/vm_statistics_view.dart
@@ -19,7 +19,6 @@ class VMStatisticsView extends VMDeveloperView { const VMStatisticsView() : super( - id, title: 'VM', icon: Icons.devices, );
diff --git a/packages/devtools_app/lib/src/service/timeline_streams.dart b/packages/devtools_app/lib/src/service/timeline_streams.dart index 79b4fca..d5e8469 100644 --- a/packages/devtools_app/lib/src/service/timeline_streams.dart +++ b/packages/devtools_app/lib/src/service/timeline_streams.dart
@@ -70,10 +70,6 @@ return _streams.values.where(condition).toList(); } - ValueListenable<bool>? timelineStreamListenable(String name) { - return _streams.containsKey(name) ? _streams[name]!.recorded : null; - } - /// Initializes stream values from the vm service as a source of truth. Future<void> _initStreams() async { final timelineFlags = await service!.getVMTimelineFlags();
diff --git a/packages/devtools_app/lib/src/service/vm_service_wrapper.dart b/packages/devtools_app/lib/src/service/vm_service_wrapper.dart index b0eb257..f76d914 100644 --- a/packages/devtools_app/lib/src/service/vm_service_wrapper.dart +++ b/packages/devtools_app/lib/src/service/vm_service_wrapper.dart
@@ -981,7 +981,7 @@ vmServiceCallCount++; vmServiceCalls.add(name); - final trackedFuture = TrackedFuture(name, localFuture as Future<Object>); + final trackedFuture = TrackedFuture<Object>(name); if (_allFuturesCompleter.isCompleted) { _allFuturesCompleter = Completer<bool>(); } @@ -1137,8 +1137,7 @@ } class TrackedFuture<T> { - TrackedFuture(this.name, this.future); + TrackedFuture(this.name); final String name; - final Future<T> future; }
diff --git a/packages/devtools_app/lib/src/shared/console/eval/inspector_tree.dart b/packages/devtools_app/lib/src/shared/console/eval/inspector_tree.dart index 1481936..17fd210 100644 --- a/packages/devtools_app/lib/src/shared/console/eval/inspector_tree.dart +++ b/packages/devtools_app/lib/src/shared/console/eval/inspector_tree.dart
@@ -18,7 +18,6 @@ import '../../diagnostics/diagnostics_node.dart'; import '../../ui/search.dart'; import '../../utils.dart'; -import '../primitives/simple_items.dart'; /// Split text into two groups, word characters at the start of a string and all /// other characters. @@ -98,8 +97,6 @@ Iterable<InspectorTreeNode> get children => _children; - bool get isCreatedByLocalProject => _diagnostic!.isCreatedByLocalProject; - bool get isProperty { final diagnosticLocal = diagnostic; return diagnosticLocal == null || diagnosticLocal.isProperty; @@ -167,8 +164,6 @@ int get subtreeSize => childrenCount + 1; - bool get isLeaf => _children.isEmpty; - // TODO(jacobr): move getRowIndex to the InspectorTree class. int getRowIndex(InspectorTreeNode node) { int index = 0; @@ -294,35 +289,19 @@ class InspectorTreeConfig { InspectorTreeConfig({ - required this.summaryTree, - required this.treeType, this.onNodeAdded, this.onClientActiveChange, this.onSelectionChange, this.onExpand, - this.onHover, }); - final bool summaryTree; - final FlutterTreeType treeType; final NodeAddedCallback? onNodeAdded; final VoidCallback? onSelectionChange; final void Function(bool added)? onClientActiveChange; final TreeEventCallback? onExpand; - final TreeEventCallback? onHover; } enum SearchTargetType { widget, // TODO(https://github.com/flutter/devtools/issues/3489) implement other search scopes: details, all etc } - -extension SearchTargetTypeExtension on SearchTargetType { - String get name { - switch (this) { - case SearchTargetType.widget: - default: - return 'Widget'; - } - } -}
diff --git a/packages/devtools_app/lib/src/shared/console/primitives/simple_items.dart b/packages/devtools_app/lib/src/shared/console/primitives/simple_items.dart index 55ff0d5..76e96ff 100644 --- a/packages/devtools_app/lib/src/shared/console/primitives/simple_items.dart +++ b/packages/devtools_app/lib/src/shared/console/primitives/simple_items.dart
@@ -4,9 +4,5 @@ // TODO(jacobr): add render, semantics, and layer trees. enum FlutterTreeType { - widget('Widget'); - - const FlutterTreeType(this.title); - - final String title; + widget, }
diff --git a/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart b/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart index 637e8db..3f45982 100644 --- a/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart +++ b/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart
@@ -119,18 +119,6 @@ bool get hoverEvalModeEnabledByDefault; - Future<Object> forceRefresh() { - final futures = <Future<void>>[]; - for (InspectorServiceClient client in clients) { - try { - futures.add(client.onForceRefresh()); - } catch (e) { - log(e.toString()); - } - } - return Future.wait(futures); - } - Future<bool> invokeBoolServiceMethodNoArgs(String methodName) async { return useDaemonApi ? await invokeServiceMethodDaemonNoGroupArgs(methodName) == true @@ -211,7 +199,6 @@ ); } - ValueListenable<List<String>> get rootDirectories => _rootDirectories; final ValueNotifier<List<String>> _rootDirectories = ValueNotifier([]); @visibleForTesting @@ -638,40 +625,6 @@ return disposeComplete; } - Future<T?> nullIfDisposed<T>(Future<T> Function() supplier) async { - if (disposed) { - return null; - } - return await supplier(); - } - - T? nullValueIfDisposed<T>(T Function() supplier) { - if (disposed) { - return null; - } - - return supplier(); - } - - void skipIfDisposed(void Function() runnable) { - if (disposed) { - return; - } - - runnable(); - } - - Future<RemoteDiagnosticsNode?> invokeServiceMethodReturningNode( - String methodName, - ) async { - if (disposed) return null; - return useDaemonApi - ? parseDiagnosticsNodeDaemon(invokeServiceMethodDaemon(methodName)) - : parseDiagnosticsNodeObservatory( - invokeServiceMethodObservatory(methodName), - ); - } - Future<RemoteDiagnosticsNode?> invokeServiceMethodReturningNodeInspectorRef( String methodName, InspectorInstanceRef? ref, @@ -700,18 +653,6 @@ ); } - Future<void> invokeVoidServiceMethodInspectorRef( - String methodName, - InspectorInstanceRef ref, - ) async { - if (disposed) return; - if (useDaemonApi) { - await invokeServiceMethodDaemonInspectorRef(methodName, ref); - } else { - await invokeServiceMethodObservatoryInspectorRef(methodName, ref); - } - } - Future<Object?> invokeServiceMethodDaemonArg( String methodName, String? arg, @@ -741,25 +682,6 @@ ); } - /// Call a service method passing in an observatory instance reference. - /// - /// This call is useful when receiving an 'inspect' event from the - /// observatory and future use cases such as inspecting a Widget from a - /// log window. - /// - /// This method will always need to use the observatory service as the input - /// parameter is an Observatory InstanceRef.. - Future<InstanceRef?> invokeServiceMethodOnRefObservatory( - String methodName, - InstanceRef arg, - ) { - return inspectorLibrary.eval( - "${inspectorService.clientInspectorName}.instance.$methodName(arg1, '$groupName')", - isAlive: this, - scope: {'arg1': arg.id!}, - ); - } - Future<void> invokeVoidServiceMethod(String methodName, String arg1) async { if (disposed) return; if (useDaemonApi) { @@ -779,14 +701,6 @@ ); } - /// Invokes a static method on the inspector service passing in the specified - /// arguments. - /// - /// Intent is we could refactor how the API is invoked by only changing this call. - Future<InstanceRef?> invokeServiceMethodObservatory(String methodName) { - return invokeServiceMethodObservatory1(methodName, groupName); - } - Future<InstanceRef?> invokeServiceMethodObservatory1( String methodName, String arg1, @@ -939,16 +853,6 @@ ); } - Future<InspectorInstanceRef?> fromInstanceRef(InstanceRef instanceRef) async { - final inspectorIdRef = await inspectorLibrary.eval( - "${inspectorService.clientInspectorName}.instance.toId(obj, '$groupName')", - scope: {'obj': instanceRef.id!}, - isAlive: this, - ); - if (inspectorIdRef is! InstanceRef) return null; - return InspectorInstanceRef(inspectorIdRef.valueAsString); - } - Future<Instance?> getInstance(FutureOr<InstanceRef?> instanceRef) async { if (disposed) { return null; @@ -1034,17 +938,6 @@ return properties; } - Future<SourcePosition?> getPropertyLocation( - InstanceRef instanceRef, - String name, - ) async { - final Instance? instance = await getInstance(instanceRef); - if (instance == null || disposed) { - return null; - } - return getPropertyLocationHelper(instance.classRef!, name); - } - Future<SourcePosition?> getPropertyLocationHelper( ClassRef classRef, String name, @@ -1198,20 +1091,6 @@ ); } - Future<RemoteDiagnosticsNode?> getRootWidgetFullTree() { - return invokeServiceMethodReturningNode( - WidgetInspectorServiceExtensions.getRootWidget.name, - ); - } - - Future<RemoteDiagnosticsNode?> getSummaryTreeWithoutIds() { - return parseDiagnosticsNodeDaemon( - invokeServiceMethodDaemon( - WidgetInspectorServiceExtensions.getRootWidgetSummaryTree.name, - ), - ); - } - // TODO these ones could be not needed. /* TODO(jacobr): this probably isn't needed. Future<List<DiagnosticsPathNode>> getParentChain(DiagnosticsNode target) async { @@ -1478,11 +1357,6 @@ return _pendingNext!.future; } - ObjectGroup? get current { - _current ??= inspectorService.createObjectGroup(debugName); - return _current; - } - ObjectGroup get next { _next ??= inspectorService.createObjectGroup(debugName); return _next!;
diff --git a/packages/devtools_app/lib/src/shared/diagnostics/primitives/source_location.dart b/packages/devtools_app/lib/src/shared/diagnostics/primitives/source_location.dart index a79bd98..24eef08 100644 --- a/packages/devtools_app/lib/src/shared/diagnostics/primitives/source_location.dart +++ b/packages/devtools_app/lib/src/shared/diagnostics/primitives/source_location.dart
@@ -9,7 +9,6 @@ class _JsonFields { static const String file = 'file'; static const String line = 'line'; - static const String name = 'name'; static const String column = 'column'; } @@ -35,29 +34,13 @@ int getLine() => JsonUtils.getIntMember(json, _JsonFields.line); - String? getName() => JsonUtils.getStringMember(json, _JsonFields.name); - int getColumn() => JsonUtils.getIntMember(json, _JsonFields.column); - - SourcePosition? getXSourcePosition() { - final file = getFile(); - if (file == null) { - return null; - } - final int line = getLine(); - final int column = getColumn(); - if (line < 0 || column < 0) { - return null; - } - return SourcePosition(file: file, line: line - 1, column: column - 1); - } } class SourcePosition { const SourcePosition({ required this.line, required this.column, - this.file, this.tokenPos, }); @@ -69,7 +52,6 @@ ); } - final String? file; final int? line; final int? column; final int? tokenPos;
diff --git a/packages/devtools_app/lib/src/shared/error_badge_manager.dart b/packages/devtools_app/lib/src/shared/error_badge_manager.dart index 1f77c18..28aa213 100644 --- a/packages/devtools_app/lib/src/shared/error_badge_manager.dart +++ b/packages/devtools_app/lib/src/shared/error_badge_manager.dart
@@ -190,8 +190,6 @@ InspectableWidgetError(String errorMessage, String id, {bool read = false}) : super(errorMessage, id, read: read); - String get inspectorRef => id; - @override InspectableWidgetError asRead() => InspectableWidgetError(errorMessage, id, read: true);
diff --git a/packages/devtools_app/lib/src/shared/http/http_request_data.dart b/packages/devtools_app/lib/src/shared/http/http_request_data.dart index b627f64..ea6dd35 100644 --- a/packages/devtools_app/lib/src/shared/http/http_request_data.dart +++ b/packages/devtools_app/lib/src/shared/http/http_request_data.dart
@@ -53,8 +53,6 @@ HttpProfileRequestRef _request; - bool isOutStanding = false; - final ValueNotifier<int> _updateCount = ValueNotifier<int>(0); /// A notifier that changes when the request data, or it's response body
diff --git a/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart b/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart index 807cc43..b59a942 100644 --- a/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart +++ b/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart
@@ -51,7 +51,6 @@ class AdaptedHeapData { AdaptedHeapData( this.objects, { - required this.isolateId, this.rootIndex = _defaultRootIndex, DateTime? created, }) : assert(objects.isNotEmpty), @@ -62,9 +61,8 @@ static final _uiReleaser = UiReleaser(); static Future<AdaptedHeapData> fromHeapSnapshot( - HeapSnapshotGraph graph, { - required String isolateId, - }) async { + HeapSnapshotGraph graph, + ) async { final objects = <AdaptedHeapObject>[]; for (final i in Iterable.generate(graph.objects.length)) { if (_uiReleaser.step()) await _uiReleaser.releaseUi(); @@ -73,19 +71,18 @@ objects.add(object); } - return AdaptedHeapData(objects, isolateId: isolateId); + return AdaptedHeapData(objects); } @visibleForTesting static Future<AdaptedHeapData> fromFile( - String fileName, { - String isolateId = '', - }) async { + String fileName, + ) async { final file = File(fileName); final bytes = await file.readAsBytes(); final data = bytes.buffer.asByteData(); final graph = HeapSnapshotGraph.fromChunks([data]); - return AdaptedHeapData.fromHeapSnapshot(graph, isolateId: isolateId); + return AdaptedHeapData.fromHeapSnapshot(graph); } /// Default value for rootIndex is taken from the doc: @@ -98,8 +95,6 @@ final List<AdaptedHeapObject> objects; - final String isolateId; - /// Total size of all objects in the heap. /// /// Should be set externally.
diff --git a/packages/devtools_app/lib/src/shared/notifications.dart b/packages/devtools_app/lib/src/shared/notifications.dart index 3177871..35e9bb4 100644 --- a/packages/devtools_app/lib/src/shared/notifications.dart +++ b/packages/devtools_app/lib/src/shared/notifications.dart
@@ -141,10 +141,6 @@ void markComplete(NotificationMessage message) { activeMessages.removeWhere((element) => element == message); } - - void dispose() { - newTasks.dispose(); - } } class NotificationAction extends StatelessWidget {
diff --git a/packages/devtools_app/lib/src/shared/offline_mode.dart b/packages/devtools_app/lib/src/shared/offline_mode.dart index d85e520..74f4e71 100644 --- a/packages/devtools_app/lib/src/shared/offline_mode.dart +++ b/packages/devtools_app/lib/src/shared/offline_mode.dart
@@ -13,8 +13,6 @@ import 'routing.dart'; class OfflineModeController { - bool get isOffline => _offlineMode.value; - ValueListenable<bool> get offlineMode => _offlineMode; final _offlineMode = ValueNotifier<bool>(false);
diff --git a/packages/devtools_app/lib/src/shared/primitives/custom_pointer_scroll_view.dart b/packages/devtools_app/lib/src/shared/primitives/custom_pointer_scroll_view.dart index 68fd6ff..d355922 100644 --- a/packages/devtools_app/lib/src/shared/primitives/custom_pointer_scroll_view.dart +++ b/packages/devtools_app/lib/src/shared/primitives/custom_pointer_scroll_view.dart
@@ -266,29 +266,6 @@ return widget?.scrollable; } - /// Provides a heuristic to determine if expensive frame-bound tasks should be - /// deferred for the [context] at a specific point in time. - /// - /// Calling this method does _not_ create a dependency on any other widget. - /// This also means that the value returned is only good for the point in time - /// when it is called, and callers will not get updated if the value changes. - /// - /// The heuristic used is determined by the [physics] of this [Scrollable] - /// via [ScrollPhysics.recommendDeferredScrolling]. That method is called with - /// the current [activity]'s [ScrollActivity.velocity]. - /// - /// If there is no [Scrollable] in the widget tree above the [context], this - /// method returns false. - static bool recommendDeferredLoadingForContext(BuildContext context) { - final _ScrollableScope? widget = context - .getElementForInheritedWidgetOfExactType<_ScrollableScope>() - ?.widget as _ScrollableScope?; - if (widget == null) { - return false; - } - return widget.position.recommendDeferredLoading(context); - } - /// Scrolls the scrollables that enclose the given context so as to make the /// given context visible. static Future<void> ensureVisible(
diff --git a/packages/devtools_app/lib/src/shared/primitives/trace_event.dart b/packages/devtools_app/lib/src/shared/primitives/trace_event.dart index 499e538..d42bccb 100644 --- a/packages/devtools_app/lib/src/shared/primitives/trace_event.dart +++ b/packages/devtools_app/lib/src/shared/primitives/trace_event.dart
@@ -35,8 +35,6 @@ static const durationBeginPhase = 'B'; static const durationEndPhase = 'E'; static const durationCompletePhase = 'X'; - static const flowStartPhase = 's'; - static const flowEndPhase = 'f'; static const metadataEventPhase = 'M'; static const gcCategory = 'GC'; @@ -107,10 +105,6 @@ set type(TimelineEventType t) => _type = t; - bool get isUiEvent => type == TimelineEventType.ui; - - bool get isRasterEvent => type == TimelineEventType.raster; - TraceEvent copy({ String? name, String? category, @@ -151,8 +145,6 @@ Map<String, dynamic> get json => event.json; - bool processed = false; - bool get isShaderEvent => event.args!['devtoolsTag'] == 'shaders'; @override
diff --git a/packages/devtools_app/lib/src/shared/primitives/trees.dart b/packages/devtools_app/lib/src/shared/primitives/trees.dart index 2fea15b..c97631f 100644 --- a/packages/devtools_app/lib/src/shared/primitives/trees.dart +++ b/packages/devtools_app/lib/src/shared/primitives/trees.dart
@@ -158,10 +158,6 @@ ); } - void removeLastChild() { - children.removeLast(); - } - bool subtreeHasNodeWithCondition(bool Function(T node) condition) { final T? childWithCondition = firstChildWithCondition(condition); return childWithCondition != null;
diff --git a/packages/devtools_app/lib/src/shared/primitives/utils.dart b/packages/devtools_app/lib/src/shared/primitives/utils.dart index 1746e62..f4d5445 100644 --- a/packages/devtools_app/lib/src/shared/primitives/utils.dart +++ b/packages/devtools_app/lib/src/shared/primitives/utils.dart
@@ -33,8 +33,6 @@ // 2^52 is the max int for dart2js. final int maxJsInt = pow(2, 52) as int; -String escape(String? text) => text == null ? '' : htmlEscape.convert(text); - final NumberFormat nf = NumberFormat.decimalPattern(); String percent(double d, {int fractionDigits = 2}) => @@ -435,19 +433,6 @@ static int getIntMember(Map<String, Object?> json, String memberName) { return json[memberName] as int? ?? -1; } - - static List<String> getValues(Map<String, Object> json, String member) { - final values = json[member] as List<Object?>?; - if (values == null || values.isEmpty) { - return const []; - } - - return values.cast(); - } - - static bool hasJsonData(String? data) { - return data != null && data.isNotEmpty && data != 'null'; - } } /// Add pretty print for a JSON payload. @@ -1129,20 +1114,6 @@ ]; } - Iterable<T> whereFromIndex( - bool Function(T element) test, { - int startIndex = 0, - }) { - final whereList = <T>[]; - for (int i = startIndex; i < length; i++) { - final element = this[i]; - if (test(element)) { - whereList.add(element); - } - } - return whereList; - } - bool containsWhere(bool Function(T element) test) { for (var e in this) { if (test(e)) {
diff --git a/packages/devtools_app/lib/src/shared/profiler_utils.dart b/packages/devtools_app/lib/src/shared/profiler_utils.dart index 1abfcc6..c6ad978 100644 --- a/packages/devtools_app/lib/src/shared/profiler_utils.dart +++ b/packages/devtools_app/lib/src/shared/profiler_utils.dart
@@ -252,7 +252,6 @@ required this.methodName, required this.packageUri, required this.sourceLine, - required this.isSelected, this.displayInRow = true, super.key, }); @@ -265,8 +264,6 @@ final int? sourceLine; - final bool isSelected; - final bool displayInRow; @override
diff --git a/packages/devtools_app/lib/src/shared/routing.dart b/packages/devtools_app/lib/src/shared/routing.dart index df04cfe..25c494f 100644 --- a/packages/devtools_app/lib/src/shared/routing.dart +++ b/packages/devtools_app/lib/src/shared/routing.dart
@@ -333,9 +333,6 @@ ...state, }; - factory DevToolsNavigationState.fromJson(Map<String, dynamic> json) => - DevToolsNavigationState._(json.cast<String, String?>()); - DevToolsNavigationState._(this._state) : kind = _state[_kKind]!; static const _kKind = '_kind';
diff --git a/packages/devtools_app/lib/src/shared/screen.dart b/packages/devtools_app/lib/src/shared/screen.dart index fdc3922..08abcba 100644 --- a/packages/devtools_app/lib/src/shared/screen.dart +++ b/packages/devtools_app/lib/src/shared/screen.dart
@@ -299,8 +299,6 @@ /// should return `null`. String? get docPageId => null; - int get badgeCount => 0; - double approximateTabWidth( TextTheme textTheme, { bool includeTabBarSpacing = true,
diff --git a/packages/devtools_app/lib/src/shared/table/table_data.dart b/packages/devtools_app/lib/src/shared/table/table_data.dart index 877e295..bd10358 100644 --- a/packages/devtools_app/lib/src/shared/table/table_data.dart +++ b/packages/devtools_app/lib/src/shared/table/table_data.dart
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:async'; - import 'package:devtools_app_shared/ui.dart'; import 'package:flutter/material.dart'; @@ -111,16 +109,6 @@ static double get treeToggleWidth => scaleByFontFactor(14.0); - final StreamController<T> nodeExpandedController = - StreamController<T>.broadcast(); - - Stream<T> get onNodeExpanded => nodeExpandedController.stream; - - final StreamController<T> nodeCollapsedController = - StreamController<T>.broadcast(); - - Stream<T> get onNodeCollapsed => nodeCollapsedController.stream; - @override double getNodeIndentPx(T dataObject) { return dataObject.level * treeToggleWidth;
diff --git a/packages/devtools_app/lib/src/shared/ui/filter.dart b/packages/devtools_app/lib/src/shared/ui/filter.dart index 3b52c51..7c4a26a 100644 --- a/packages/devtools_app/lib/src/shared/ui/filter.dart +++ b/packages/devtools_app/lib/src/shared/ui/filter.dart
@@ -128,13 +128,11 @@ required this.controller, this.includeQueryFilter = true, this.queryInstructions, - double? dialogWidth, }) : assert( !includeQueryFilter || (queryInstructions != null && controller._queryFilterArgs.isNotEmpty), ), - dialogWidth = dialogWidth ?? defaultDialogWidth, toggleFilterValuesAtOpen = List.generate( controller.activeFilter.value.toggleFilters.length, (index) => @@ -147,8 +145,6 @@ final bool includeQueryFilter; - final double dialogWidth; - final List<bool> toggleFilterValuesAtOpen; @override @@ -377,8 +373,6 @@ bool isNegative; - bool get isNotEmpty => values.isNotEmpty; - String get display => values.isNotEmpty ? '${isNegative ? negativePrefix : ''}${keys.first}:${values.join(valueSeparator)}' : '';
diff --git a/packages/devtools_app/lib/src/shared/ui/search.dart b/packages/devtools_app/lib/src/shared/ui/search.dart index 557e299..18fddc6 100644 --- a/packages/devtools_app/lib/src/shared/ui/search.dart +++ b/packages/devtools_app/lib/src/shared/ui/search.dart
@@ -762,14 +762,6 @@ ); } - void selectFromSearchField(String selection) { - searchTextFieldController.clear(); - search = selection; - clearSearchField(force: true); - selectTheSearch = true; - closeAutoCompleteOverlay(); - } - void clearSearchField({bool force = false}) { if (force || search.isNotEmpty) { resetSearch(); @@ -802,12 +794,6 @@ bool directionDown, ); -/// Callback for clearing the search field. -typedef ClearSearchField = Function( - AutoCompleteSearchControllerMixin controller, { - bool force, -}); - /// Provided by clients to specify where the autocomplete overlay should be /// positioned relative to the input text. typedef OverlayXPositionBuilder = double Function(
diff --git a/packages/devtools_app/test/inspector/inspector_tree_test.dart b/packages/devtools_app/test/inspector/inspector_tree_test.dart index 8500eb4..56f9471 100644 --- a/packages/devtools_app/test/inspector/inspector_tree_test.dart +++ b/packages/devtools_app/test/inspector/inspector_tree_test.dart
@@ -74,8 +74,6 @@ (WidgetTester tester) async { final treeController = InspectorTreeController() ..config = InspectorTreeConfig( - summaryTree: false, - treeType: FlutterTreeType.widget, onNodeAdded: (_, __) {}, onClientActiveChange: (_) {}, );
diff --git a/packages/devtools_app/test/inspector/utils/inspector_tree.dart b/packages/devtools_app/test/inspector/utils/inspector_tree.dart index 5870c50..2023026 100644 --- a/packages/devtools_app/test/inspector/utils/inspector_tree.dart +++ b/packages/devtools_app/test/inspector/utils/inspector_tree.dart
@@ -14,8 +14,6 @@ ) { final controller = InspectorTreeController() ..config = InspectorTreeConfig( - summaryTree: false, - treeType: FlutterTreeType.widget, onNodeAdded: (_, __) {}, onClientActiveChange: (_) {}, );
diff --git a/packages/devtools_app/test/memory/diff/controller/heap_diff_test.dart b/packages/devtools_app/test/memory/diff/controller/heap_diff_test.dart index f2c49f4..6c1fe50 100644 --- a/packages/devtools_app/test/memory/diff/controller/heap_diff_test.dart +++ b/packages/devtools_app/test/memory/diff/controller/heap_diff_test.dart
@@ -89,7 +89,6 @@ final heap = AdaptedHeapData( objects, rootIndex: 0, - isolateId: '', ); await calculateHeap(heap); @@ -125,6 +124,5 @@ ), ], rootIndex: 0, - isolateId: '', ), );
diff --git a/packages/devtools_app/test/memory/shared/heap/heap_analyzer_test.dart b/packages/devtools_app/test/memory/shared/heap/heap_analyzer_test.dart index b5f32f6..eb843fa 100644 --- a/packages/devtools_app/test/memory/shared/heap/heap_analyzer_test.dart +++ b/packages/devtools_app/test/memory/shared/heap/heap_analyzer_test.dart
@@ -256,7 +256,7 @@ } AdaptedHeapData _heapData(List<AdaptedHeapObject> objects) { - return AdaptedHeapData(objects, isolateId: '', rootIndex: 0); + return AdaptedHeapData(objects, rootIndex: 0); } /// For convenience of testing each heap object has code equal to the
diff --git a/packages/devtools_app/test/memory/shared/heap/heap_test.dart b/packages/devtools_app/test/memory/shared/heap/heap_test.dart index acb4e4b..fb13f76 100644 --- a/packages/devtools_app/test/memory/shared/heap/heap_test.dart +++ b/packages/devtools_app/test/memory/shared/heap/heap_test.dart
@@ -39,7 +39,6 @@ _createOneByteObject(3, [], _classA), ], rootIndex: 0, - isolateId: '', ), expectedClassARetainedSize: 3, ), @@ -53,7 +52,6 @@ _createOneByteObject(3, [], _classA), ], rootIndex: 0, - isolateId: '', ), expectedClassARetainedSize: 3, ), @@ -67,7 +65,6 @@ _createOneByteObject(3, [1, 2], _classA), ], rootIndex: 0, - isolateId: '', ), expectedClassARetainedSize: 3, ), @@ -82,7 +79,6 @@ _createOneByteObject(4, [], _classB), ], rootIndex: 0, - isolateId: '', ), expectedClassARetainedSize: 4, ),
diff --git a/packages/devtools_app/test/network/network_table_test.dart b/packages/devtools_app/test/network/network_table_test.dart index c0c02d4..6c6e88d 100644 --- a/packages/devtools_app/test/network/network_table_test.dart +++ b/packages/devtools_app/test/network/network_table_test.dart
@@ -44,7 +44,6 @@ httpProfile.requests, 0, currentRequests: currentRequests, - invalidRequests: [], ); requests = networkRequests.requests; });
diff --git a/packages/devtools_app/test/test_infra/scenes/memory/default.dart b/packages/devtools_app/test/test_infra/scenes/memory/default.dart index 038c279..3a46f14 100644 --- a/packages/devtools_app/test/test_infra/scenes/memory/default.dart +++ b/packages/devtools_app/test/test_infra/scenes/memory/default.dart
@@ -152,7 +152,6 @@ return AdaptedHeapData( objects, rootIndex: rootIndex, - isolateId: '', ); }
diff --git a/packages/devtools_app/test/test_infra/test_data/memory/heap/heap_data.dart b/packages/devtools_app/test/test_infra/test_data/memory/heap/heap_data.dart index 9de0c19..01d8720 100644 --- a/packages/devtools_app/test/test_infra/test_data/memory/heap/heap_data.dart +++ b/packages/devtools_app/test/test_infra/test_data/memory/heap/heap_data.dart
@@ -21,7 +21,7 @@ /// /// Format is format used by [NativeRuntime.writeHeapSnapshotToFile]. Future<AdaptedHeapData> loadHeap() => - AdaptedHeapData.fromFile('$_dataDir$fileName', isolateId: 'test'); + AdaptedHeapData.fromFile('$_dataDir$fileName'); } List<GoldenHeapTest> goldenHeapTests = <GoldenHeapTest>[
diff --git a/packages/devtools_app_shared/CHANGELOG.md b/packages/devtools_app_shared/CHANGELOG.md index 476d802..2257da6 100644 --- a/packages/devtools_app_shared/CHANGELOG.md +++ b/packages/devtools_app_shared/CHANGELOG.md
@@ -1,4 +1,9 @@ ## 0.0.7 +* Remove public getter `libraryRef`, and public methods `getLibrary` and `retrieveFullValueAsString` from `EvalOnDartLibrary`. +* Change `toString` output for `UnknownEvalException`, `EvalSentinelException`, and `EvalErrorException`. +* Remove public getters `flutterVersionSummary`, `frameworkVersionSummary`, and `engineVersionSummary` from `FlutterVersion`. +* Remove public getters `onIsolateCreated` and `onIsolateExited` from `IsolateManager`. +* Remove public getter `firstFrameReceived` from `ServiceExtensionManager`. * Add `RoundedButtonGroup` common widget. ## 0.0.6
diff --git a/packages/devtools_app_shared/lib/src/service/eval_on_dart_library.dart b/packages/devtools_app_shared/lib/src/service/eval_on_dart_library.dart index 43b6753..d33de9c 100644 --- a/packages/devtools_app_shared/lib/src/service/eval_on_dart_library.dart +++ b/packages/devtools_app_shared/lib/src/service/eval_on_dart_library.dart
@@ -17,7 +17,6 @@ import '../utils/auto_dispose.dart'; import 'service_manager.dart'; -import 'service_utils.dart'; final _log = Logger('eval_on_dart_library'); @@ -102,7 +101,6 @@ int _currentRequestId = 0; late Completer<LibraryRef> _libraryRef; - Future<LibraryRef> get libraryRef => _libraryRef.future; Completer? allPendingRequestsDone; @@ -292,10 +290,6 @@ return value; } - Future<Library?> getLibrary(LibraryRef instance, Disposable isAlive) { - return getObjHelper(instance, isAlive); - } - Future<Class?> getClass(ClassRef instance, Disposable isAlive) { return getObjHelper(instance, isAlive); } @@ -633,10 +627,6 @@ return value; }); } - - Future<String?> retrieveFullValueAsString(InstanceRef stringRef) { - return service.retrieveFullStringValue(_isolateRef!.id!, stringRef); - } } final class LibraryNotFound implements Exception { @@ -644,7 +634,10 @@ final String name; - String get message => 'Library matchining $name not found'; + String get message => 'Library matching $name not found'; + + @override + String toString() => message; } final class FutureFailedException implements Exception { @@ -675,7 +668,7 @@ @override String toString() { - return 'Unknown error during the evaluation of `$expression`: $exception'; + return 'Unknown error during the evaluation of `$expression`: $exception for scope: $scope'; } } @@ -702,7 +695,7 @@ @override String toString() { - return 'Evaluation `$expression` returned the Sentinel $sentinel'; + return 'Evaluation `$expression` returned the Sentinel $sentinel for scope: $scope'; } } @@ -719,6 +712,6 @@ @override String toString() { - return 'Evaluation `$expression` failed with $errorRef'; + return 'Evaluation `$expression` failed with $errorRef for scope: $scope'; } }
diff --git a/packages/devtools_app_shared/lib/src/service/flutter_version.dart b/packages/devtools_app_shared/lib/src/service/flutter_version.dart index c3eb6e8..824325f 100644 --- a/packages/devtools_app_shared/lib/src/service/flutter_version.dart +++ b/packages/devtools_app_shared/lib/src/service/flutter_version.dart
@@ -57,17 +57,6 @@ final SemanticVersion? dartSdkVersion; - String get flutterVersionSummary => [ - if (version != 'unknown') version, - 'channel $channel', - repositoryUrl ?? 'unknown source', - ].join(' • '); - - String get frameworkVersionSummary => - 'revision $frameworkRevision • $frameworkCommitDate'; - - String get engineVersionSummary => 'revision $engineRevision'; - @override // ignore: avoid-dynamic, necessary here. bool operator ==(other) {
diff --git a/packages/devtools_app_shared/lib/src/service/isolate_manager.dart b/packages/devtools_app_shared/lib/src/service/isolate_manager.dart index e506440..2548443 100644 --- a/packages/devtools_app_shared/lib/src/service/isolate_manager.dart +++ b/packages/devtools_app_shared/lib/src/service/isolate_manager.dart
@@ -45,10 +45,6 @@ ValueListenable<List<IsolateRef>> get isolates => _isolates; final _isolates = ListValueNotifier(const <IsolateRef>[]); - Stream<IsolateRef?> get onIsolateCreated => _isolateCreatedController.stream; - - Stream<IsolateRef?> get onIsolateExited => _isolateExitedController.stream; - ValueListenable<IsolateRef?> get mainIsolate => _mainIsolate; final _mainIsolate = ValueNotifier<IsolateRef?>(null);
diff --git a/packages/devtools_app_shared/lib/src/service/service_extension_manager.dart b/packages/devtools_app_shared/lib/src/service/service_extension_manager.dart index ac51377..e8e6879 100644 --- a/packages/devtools_app_shared/lib/src/service/service_extension_manager.dart +++ b/packages/devtools_app_shared/lib/src/service/service_extension_manager.dart
@@ -27,7 +27,6 @@ final IsolateManager _isolateManager; - Future<void> get firstFrameReceived => _firstFrameReceived.future; Completer<void> _firstFrameReceived = Completer(); bool get _firstFrameEventReceived => _firstFrameReceived.isCompleted;
diff --git a/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart b/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart index 5ca526b..adbc7f3 100644 --- a/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart +++ b/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart
@@ -26,9 +26,7 @@ this._resolvedUriMap, this._classList, List<({String flagName, String value})>? flags, - ) : _startingSockets = _socketProfile?.sockets ?? [], - _startingRequests = _httpProfile?.requests ?? [], - cpuSamples = cpuSamples ?? _defaultProfile, + ) : cpuSamples = cpuSamples ?? _defaultProfile, allocationSamples = allocationSamples ?? _defaultProfile { _reverseResolvedUriMap = <String, String>{}; if (_resolvedUriMap != null) { @@ -66,15 +64,10 @@ /// Specifies the return value of `socketProfilingEnabled`. bool socketProfilingEnabledResult = true; - /// Specifies the dart:io service extension version. - SemanticVersion dartIoVersion = SemanticVersion(major: 1, minor: 3); - final VmFlagManager _vmFlagManager; final Timeline? _timelineData; - SocketProfile? _socketProfile; - final List<SocketStatistic> _startingSockets; - HttpProfile? _httpProfile; - final List<HttpProfileRequest> _startingRequests; + final SocketProfile? _socketProfile; + final HttpProfile? _httpProfile; final SamplesMemoryJson? _memoryData; final AllocationMemoryJson? _allocationData; final Map<String, String>? _resolvedUriMap; @@ -394,10 +387,6 @@ return Future.value(_socketProfile ?? SocketProfile(sockets: [])); } - void restoreFakeSockets() { - _socketProfile = SocketProfile(sockets: _startingSockets); - } - @override Future<bool> isHttpProfilingAvailable(String isolateId) => Future.value(true); @@ -425,10 +414,6 @@ return Future.value(Success()); } - void restoreFakeHttpProfileRequests() { - _httpProfile = HttpProfile(requests: _startingRequests, timestamp: 0); - } - @override Future<Success> clearCpuSamples(String isolateId) => Future.value(Success());
diff --git a/packages/devtools_test/lib/src/mocks/mocks.dart b/packages/devtools_test/lib/src/mocks/mocks.dart index 36c373e..bd0909e 100644 --- a/packages/devtools_test/lib/src/mocks/mocks.dart +++ b/packages/devtools_test/lib/src/mocks/mocks.dart
@@ -289,17 +289,6 @@ ), ); -final mockLargeParsedScript = ParsedScript( - script: mockLargeScript!, - highlighter: mockSyntaxHighlighter, - executableLines: executableLines, - sourceReport: ProcessedSourceReport( - coverageHitLines: coverageHitLines, - coverageMissedLines: coverageMissLines, - profilerEntries: profilerEntries, - ), -); - final mockScriptRefs = [ ScriptRef(uri: 'zoo:animals/cats/meow.dart', id: 'fake/id/1'), ScriptRef(uri: 'zoo:animals/cats/purr.dart', id: 'fake/id/2'),
diff --git a/packages/devtools_test/lib/src/utils.dart b/packages/devtools_test/lib/src/utils.dart index 6f590e8..94fe755 100644 --- a/packages/devtools_test/lib/src/utils.dart +++ b/packages/devtools_test/lib/src/utils.dart
@@ -261,11 +261,6 @@ await Future.wait(loadFontsFuture); } -/// Helper method for finding widgets by type when they have a generic type. -/// -/// E.g. `find.byType(typeOf<MyTypeWithAGeneric<String>>());` -Type typeOf<T>() => T; - void verifyIsSearchMatch( List<SearchableDataMixin> data, List<SearchableDataMixin> matches,