Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
44523e7
Add check-unused-code to DCM CI checks.
kenzieschmoll Jul 21, 2026
76e7220
exclude public API
kenzieschmoll Jul 21, 2026
93ec692
Add excludes
kenzieschmoll Jul 21, 2026
6ebb76b
exclude test/
kenzieschmoll Jul 21, 2026
00d014e
exclude service/
kenzieschmoll Jul 21, 2026
0b896c5
exclude integration_test/
kenzieschmoll Jul 21, 2026
6d414f7
Ignore false positives in app.dart.
kenzieschmoll Jul 21, 2026
03c168c
Remove unused code in extensions/ and framework/
kenzieschmoll Jul 21, 2026
1e8add7
use if (kDebugMode)
kenzieschmoll Jul 21, 2026
6c38057
remove other assert
kenzieschmoll Jul 21, 2026
57ddcd2
Remove unused code from `screens/`
kenzieschmoll Jul 21, 2026
582da8c
fix test
kenzieschmoll Jul 21, 2026
64d384c
merge
kenzieschmoll Jul 22, 2026
8dd806c
merge
kenzieschmoll Jul 27, 2026
1d6d8c7
Resolve integration_test/ findings
kenzieschmoll Jul 27, 2026
b6d8bb2
Remove unused code from `shared`
kenzieschmoll Jul 27, 2026
ea85f52
add back fixedMinY and link bug
kenzieschmoll Jul 27, 2026
38c92e2
fix pretty print review comment
kenzieschmoll Jul 27, 2026
ff90e91
formatting
kenzieschmoll Jul 27, 2026
9115264
fix json bug
kenzieschmoll Jul 27, 2026
7edfd60
Add back toJson method
kenzieschmoll Jul 27, 2026
d5afc50
Merge branch 'master' of github.com:flutter/devtools into dcm-3
kenzieschmoll Jul 27, 2026
148299f
add note for post message stub
kenzieschmoll Jul 28, 2026
5348df0
Merge branch 'master' of github.com:flutter/devtools into dcm-3
kenzieschmoll Jul 28, 2026
c778e57
remove unused const
kenzieschmoll Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ dart_code_metrics:
# devtools_app/.
# TODO(https://github.com/flutter/devtools/issues/9906) remove these
# excludes as findings are resolved.
- integration_test/**
# Investigate internal usages of inspector_controller before removing.
# Investigate internal usages of inspector logic before removing.
- lib/src/screens/inspector/**_controller.dart
- lib/src/shared/**
- lib/src/shared/diagnostics/inspector_service.dart
- lib/src/shared/diagnostics/diagnostics_node.dart

- test/**
rules:
# - arguments-ordering Too strict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// Note: this test was modeled after the example test from Flutter Gallery:
// https://github.com/flutter/gallery/blob/master/test_benchmarks/benchmarks_test.dart

import 'dart:convert' show JsonEncoder;
import 'dart:io';

import 'package:collection/collection.dart';
import 'package:devtools_app/src/shared/primitives/utils.dart';
import 'package:devtools_test/helpers.dart';
import 'package:test/test.dart';
import 'package:web_benchmarks/metrics.dart';
Expand Down Expand Up @@ -92,10 +92,7 @@ Future<void> _runBenchmarks({bool useWasm = false}) async {

stdout.writeln('Web benchmark tests finished.');

expect(
const JsonEncoder.withIndent(' ').convert(taskResult.toJson()),
isA<String>(),
);
expect(prettyPrintJson(taskResult.toJson()), isA<String>());
expect(taskResult.scores.keys, hasLength(DevToolsBenchmark.values.length));

for (final devToolsBenchmark in DevToolsBenchmark.values) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:convert';
import 'dart:io';

import 'package:devtools_app/src/shared/primitives/utils.dart';
import 'package:web_benchmarks/analysis.dart';

import 'utils.dart';
Expand Down Expand Up @@ -61,6 +62,6 @@ void compareBenchmarks(
stdout.writeln('Baseline comparison finished.');
stdout
..writeln('==== Comparison with baseline $baselineSource ====')
..writeln(const JsonEncoder.withIndent(' ').convert(delta.toJson()))
..writeln(prettyPrintJson(delta.toJson()))
..writeln('==== End of baseline comparison ====');
}
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,9 @@ final class FlutterDaemonConstants {
static const paramsKey = 'params';
static const traceKey = 'trace';
static const wsUriKey = 'wsUri';
static const pidKey = 'pid';
static const appStopKey = 'app.stop';
static const appStartedKey = 'app.started';
static const appDebugPortKey = 'app.debugPort';
static const daemonConnectedKey = 'daemon.connected';
}

enum TestAppDevice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

import 'dart:collection';
import 'dart:convert';

import 'package:collection/collection.dart';
import 'package:string_scanner/string_scanner.dart';

import '../../shared/primitives/utils.dart';

//TODO(jacobr): cleanup.
/// A namespace for [SpanParser] utilities.
extension SpanParser on Never {
Expand Down Expand Up @@ -68,7 +69,7 @@ class Grammar {

@override
String toString() {
return const JsonEncoder.withIndent(' ').convert({
return prettyPrintJson({
'name': name,
'scopeName': scopeName,
'topLevelMatcher': topLevelMatcher.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ class InspectorTreeController extends DisposableController
/// [InspectorTreeController].
final int? gaId;

InspectorTreeNode createNode() =>
InspectorTreeNode(whenDirty: _handleDirtyNode);
InspectorTreeNode createNode() => InspectorTreeNode();

SearchTargetType _searchTarget = SearchTargetType.widget;
int _rootSetCount = 0;
Expand Down Expand Up @@ -284,15 +283,6 @@ class InspectorTreeController extends DisposableController
}
}

/// Resets the state if the root has been marked as dirty.
void _handleDirtyNode(InspectorTreeNode node) {
if (node == root) {
_cachedSelectedRow = null;
lastContentWidth = null;
_updateRows();
}
}

void setSearchTarget(SearchTargetType searchTarget) {
_searchTarget = searchTarget;
refreshSearchMatches();
Expand Down Expand Up @@ -448,10 +438,6 @@ class InspectorTreeController extends DisposableController
return inspectorRowHeight * index;
}

void nodeChanged(InspectorTreeNode node) {
node.isDirty = true;
}

void removeNodeFromParent(InspectorTreeNode node) {
node.parent?.removeChild(node);
}
Expand Down Expand Up @@ -767,7 +753,6 @@ class InspectorTreeController extends DisposableController
setupChildren(diagnostic, treeNode, children, expandChildren: true);
refreshTree(
updateTreeAction: () {
nodeChanged(treeNode);
if (treeNode == selection) {
expandPath(treeNode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,6 @@ class LogData with SearchableDataMixin {
String? _details;
Future<String> Function()? detailsComputer;

static const prettyPrinter = JsonEncoder.withIndent(' ');

String? get details => _details;

bool get needsComputing => !detailsComputed.isCompleted;
Expand All @@ -1040,10 +1038,9 @@ class LogData with SearchableDataMixin {
}

try {
return prettyPrinter
.convert(jsonDecode(details!))
.replaceAll(r'\n', '\n')
.trim();
return prettyPrintJson(
jsonDecode(details!) as Object?,
).replaceAll(r'\n', '\n').trim();
} catch (_) {
return details?.trim();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

// ignore_for_file: non_constant_identifier_names
// ignore_for_file: unused-code, platform specific imports.

import 'dart:async';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ bool get isAnalyticsEnabled =>
/// Whether the analytics controller has been initialized.
bool get isAnalyticsControllerInitialized => _analyticsController != null;

typedef AsyncAnalyticsCallback = FutureOr<void> Function();

class AnalyticsController {
AnalyticsController({
required bool enabled,
Expand All @@ -67,6 +65,7 @@ class AnalyticsController {
ValueListenable<bool> get shouldPrompt => _shouldPrompt;
final ValueNotifier<bool> _shouldPrompt;

@visibleForTesting
bool get analyticsInitialized => _analyticsInitialized;
bool _analyticsInitialized = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const slowAnimation = 'slowAnimation';
const slowAnimationDocs = 'slowAnimationDocs';
const repaintRainbow = 'repaintRainbow';
const repaintRainbowDocs = 'repaintRainbowDocs';
const debugBanner = 'debugBanner';
const togglePlatform = 'togglePlatform';
const brightnessOverride = 'brightnessOverride';
const highlightOversizedImages = 'highlightOversizedImages';
Expand All @@ -99,13 +98,6 @@ const inspectorSettings = 'inspectorSettings';
const loggingSettings = 'loggingSettings';
const refreshPubRoots = 'refreshPubRoots';

enum InspectorDetailsViewType { layoutExplorer, widgetDetailsTree }

final defaultDetailsViewToLayoutExplorer =
InspectorDetailsViewType.layoutExplorer.name;
final defaultDetailsViewToWidgetDetails =
InspectorDetailsViewType.widgetDetailsTree.name;

enum HomeScreenEvents { connectToApp, connectToNewApp, viewVmFlags }

// Logging UX actions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ part of '../constants.dart';
enum CpuProfilerEvents {
profileGranularity,
loadAllCpuSamples,
profileAppStartUp,
cpuProfileFlameChartHelp,
cpuProfileProcessingTime,
openDataFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ enum PerformanceEvents {
disableOpacityLayers,
disablePhysicalShapeLayers,
countWidgetBuilds('trackRebuildWidgets'),
collectRasterStats,
clearRasterStats,
fullScreenLayerImage,
clearRebuildStats,
perfettoLoadTrace,
perfettoScrollToTimeRange,
Expand Down Expand Up @@ -55,6 +52,5 @@ enum PerformanceDocs {
shaderCompilationDocs,
shaderCompilationDocsTooltipLink,
impellerDocsLink,
impellerDocsLinkFromRasterStats,
platformChannelsDocs,
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class InspectorScreenMetrics extends ScreenAnalyticsMetrics {
});

static const summaryTreeGaId = 0;
static const detailsTreeGaId = 1;

/// The number of times the root has been set, since the
/// [InspectorTreeController] with id [inspectorTreeControllerId], has been
Expand Down
17 changes: 6 additions & 11 deletions packages/devtools_app/lib/src/shared/charts/chart_trace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class PaintCharacteristics {

/// If specified Y scale is computed and min value is fixed.
/// Will assert if new data point is less than min specified.
// ignore: unused-code, TODO(https://github.com/flutter/devtools/issues/9910) seems like a bug.
double? fixedMinY;

/// If specified Y scale is computed and max value is fixed.
Expand Down Expand Up @@ -88,11 +89,7 @@ class PaintCharacteristics {
}

class Trace {
Trace(this.controller, this._chartType, this.characteristics) {
final minY = characteristics.fixedMinY ?? 0.0;
final maxY = characteristics.fixedMaxY ?? 0.0;
yAxis = AxisScale(minY, maxY, 30);
}
Trace(this.controller, this._chartType, this.characteristics);

final ChartController controller;

Expand All @@ -113,6 +110,7 @@ class Trace {
/// -------------------------------
late bool stacked;

// ignore: unused-code, false positive used in asserts.
String? name;

double dataYMax = 0;
Expand Down Expand Up @@ -155,8 +153,6 @@ class Trace {

ChartType get chartType => _chartType;

AxisScale? yAxis;

void clearData() {
_data.clear();
controller.dirty = true;
Expand All @@ -173,7 +169,6 @@ class Trace {
);
} else if (datum.y > dataYMax) {
dataYMax = datum.y.toDouble();
yAxis = AxisScale(0, dataYMax, 30);
}

if (datum.y > controller.yMaxValue) {
Expand Down Expand Up @@ -298,7 +293,6 @@ class AxisScale {
fraction = 0;
}
return AxisScale._(
minPoint: minPoint,
maxPoint: maxPoint,
maxTicks: maxTicks,
tickSpacing: tickSpacing,
Expand All @@ -308,16 +302,17 @@ class AxisScale {
}

AxisScale._({
required this.minPoint,
required this.maxPoint,
required this.maxTicks,
required this.tickSpacing,
required this.labelUnitExponent,
required this.labelTicks,
});

final double minPoint, maxPoint;
@visibleForTesting
final double maxPoint;

@visibleForTesting
final double maxTicks;

final double tickSpacing;
Expand Down
Loading
Loading