Skip to content
Merged
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ dart_code_metrics:
# TODO(https://github.com/flutter/devtools/issues/9906) remove these
# excludes as findings are resolved.
- integration_test/**
- lib/src/screens/**
# Investigate internal usages of inspector_controller before removing.
- lib/src/screens/inspector/**_controller.dart
- lib/src/service/**
- lib/src/shared/**
- lib/src/standalone_ui/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export 'semantics_tree_pane.dart';
class AccessibilityScreen extends Screen {
AccessibilityScreen() : super.fromMetaData(ScreenMetaData.accessibility);

static final id = ScreenMetaData.accessibility.id;

@override
Widget buildScreenBody(BuildContext context) =>
const AccessibilityScreenBody();
Expand All @@ -36,11 +34,13 @@ class AccessibilityScreenBody extends StatefulWidget {

class _AccessibilityScreenBodyState extends State<AccessibilityScreenBody>
with AutoDisposeMixin {
// ignore: unused-code, temporarily ignore since this screen is under active development.
late AccessibilityController controller;

@override
void initState() {
super.initState();
// ignore: unused-code, temporarily ignore since this screen is under active development.
controller = screenControllers.lookup<AccessibilityController>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class DiffTreeTypeDropdown extends StatelessWidget {
height: defaultButtonHeight,
child: RoundedDropDownButton<DiffTreeType>(
key: AppSizeScreen.diffTypeDropdownKey,
value: value,
isDense: true,
items: [
_buildDiffTreeTypeMenuItem(DiffTreeType.combined),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class BreakpointManager with DisposerMixin {

final _breakPositionsMap = <String, List<SourcePosition>>{};

ValueListenable<List<Breakpoint>> get breakpoints => _breakpoints;
final _breakpoints = ValueNotifier<List<Breakpoint>>([]);

ValueListenable<List<BreakpointAndSourcePosition>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ class CodeViewSourceLocationNavigationState extends DevToolsNavigationState {
DevToolsNavigationState state,
) : super(kind: type, state: state.state);

@visibleForTesting
static CodeViewSourceLocationNavigationState? fromState(
DevToolsNavigationState? state,
) {
Expand Down
15 changes: 2 additions & 13 deletions packages/devtools_app/lib/src/screens/debugger/span_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -589,19 +589,6 @@ class ScopeStack {
/// Location where the next produced span should begin.
ScopeStackLocation _nextLocation = ScopeStackLocation.zero;

/// Adds a scope for a given region.
///
/// This method is the same as calling [push] and then [pop] with the same
/// args.
void add(
String? scope, {
required ScopeStackLocation start,
required ScopeStackLocation end,
}) {
push(scope, start);
pop(scope, end);
}

/// Pushes a new scope onto the stack starting at [location].
void push(String? scope, ScopeStackLocation location) {
if (scope == null) return;
Expand Down Expand Up @@ -721,6 +708,8 @@ class ScopeStackItem {
ScopeStackItem(this.scope, this.location);

final String scope;

// ignore: unused-code, foundational to this data class.
final ScopeStackLocation location;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ final _log = Logger('syntax_highlighter');
class SyntaxHighlighter {
SyntaxHighlighter({String? source}) : source = source ?? '';

@visibleForTesting
SyntaxHighlighter.withGrammar({Grammar? grammar, String? source})
: source = source ?? '' {
_grammar = grammar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ class DeepLinkListView extends StatefulWidget {
}

class _DeepLinkListViewState extends State<DeepLinkListView> {
late DeepLinksController controller;

@override
void initState() {
super.initState();
controller = screenControllers.lookup<DeepLinksController>()
..firstLoadWithDefaultConfigurations();
screenControllers
.lookup<DeepLinksController>()
.firstLoadWithDefaultConfigurations();
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,6 @@ class AASAfileFormatSubCheck extends CommonError {
),
);

static final defaultsCaseSensitiveFormat = AASAfileFormatSubCheck(
'Applinks defaults case sensitive format',
propertyTypeMessage(
property: 'applinks.defaults.caseSensitive',
expectedType: 'boolean',
),
);

static const detailsFormat = AASAfileFormatSubCheck(
'Applinks details format',
'This test checks that the `applinks.details` property is formatted properly. Ref - '
Expand Down Expand Up @@ -402,6 +394,7 @@ class Path {
final String path;

// TODO(hangyujin): display queryParams in path table.
// ignore: unused-code, outstanding TODO.
final Map<String, String> queryParams;

/// A Boolean value that indicates whether to stop pattern matching and prevent the universal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class DeepLinksScreen extends Screen {

static final id = ScreenMetaData.deepLinks.id;

// TODO(https://github.com/flutter/devtools/issues/6013): write documentation.
// @override
// String get docPageId => id;
@override
String get docPageId => id;

@override
String get docsUrl => 'https://flutter.dev/to/deep-link-tool';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ final aasaFileFormatSubCheck = {

class ValidateIosDomainResult {
ValidateIosDomainResult(this.errorCode, this.domainErrors, this.paths);
// ignore: unused-code, this is addressed in a TODO below.
final String errorCode;
final Map<String, List<DomainError>> domainErrors;
final Map<String, List<Path>> paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ abstract class FeatureController extends DisposableController
/// [service] may be null if this service method is a first party service
/// method registered by DTD or by a DTD-internal service.
class DtdServiceMethod implements Comparable<DtdServiceMethod> {
const DtdServiceMethod({
required this.service,
required this.method,
this.capabilities,
});
const DtdServiceMethod({required this.service, required this.method});

final String? service;
final String method;
final Map<String, Object?>? capabilities;

String get displayName => [service, method].nonNulls.join('.');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import 'shared.dart';
class DTDToolsScreen extends Screen {
DTDToolsScreen() : super.fromMetaData(ScreenMetaData.dtdTools);

static final id = ScreenMetaData.dtdTools.id;

@override
Widget buildScreenBody(BuildContext _) => const DTDToolsScreenBody();
}
Expand Down
6 changes: 1 addition & 5 deletions packages/devtools_app/lib/src/screens/dtd/services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ class ServicesController extends FeatureController {
}),
for (final service in response.clientServices) ...[
for (final method in service.methods.values)
DtdServiceMethod(
service: service.name,
method: method.name,
capabilities: method.capabilities,
),
DtdServiceMethod(service: service.name, method: method.name),
],
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import 'inspector_screen_controller.dart';
class InspectorScreen extends Screen {
InspectorScreen() : super.fromMetaData(ScreenMetaData.inspector);

static const minScreenWidthForText = 900.0;

static final id = ScreenMetaData.inspector.id;

// There is not enough room to safely show the console in the embed view of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class InspectorScreenBodyState extends State<InspectorScreenBody>
SearchTargetType searchTarget = SearchTargetType.widget;

static const inspectorTreeKey = Key('Inspector Tree');
static const minScreenWidthForText = 900.0;

@override
void initState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:flutter/material.dart';

import '../../../../shared/diagnostics/diagnostics_node.dart';
import '../../../../shared/primitives/utils.dart';
import '../../inspector_controller.dart';
import '../../inspector_data_models.dart';
import '../ui/free_space.dart';
import '../ui/theme.dart';
Expand All @@ -15,14 +14,12 @@ import '../ui/widget_constraints.dart';
import '../ui/widgets_theme.dart';

class BoxLayoutExplorerWidget extends StatelessWidget {
const BoxLayoutExplorerWidget(
this.inspectorController, {
const BoxLayoutExplorerWidget({
super.key,
required this.layoutProperties,
required this.selectedNode,
});

final InspectorController inspectorController;
final LayoutProperties? layoutProperties;
final RemoteDiagnosticsNode? selectedNode;

Expand Down Expand Up @@ -230,56 +227,6 @@ class BoxLayoutExplorerWidget extends StatelessWidget {
String _describeBoxName(LayoutProperties properties) =>
properties.node.description ?? '';

/// Represents a box widget and its surrounding padding.
class BoxChildAndPaddingVisualizer extends StatelessWidget {
const BoxChildAndPaddingVisualizer({
super.key,
required this.layoutProperties,
required this.renderProperties,
required this.isSelected,
});

final bool isSelected;
final LayoutProperties layoutProperties;
final RenderProperties renderProperties;

LayoutProperties? get properties => renderProperties.layoutProperties;

@override
Widget build(BuildContext context) {
final renderSize = renderProperties.size;
final renderOffset = renderProperties.offset;

final propertiesLocal = properties!;

return Positioned(
top: renderOffset.dy,
left: renderOffset.dx,
child: SizedBox(
width: safePositiveDouble(renderSize.width),
height: safePositiveDouble(renderSize.height),
child: WidgetVisualizer(
isSelected: isSelected,
layoutProperties: layoutProperties,
title: _describeBoxName(propertiesLocal),
// TODO(jacobr): consider surfacing the overflow size information
// if we determine
// overflowSide: properties.overflowSide,

// We only show one child at a time so a large title is safe.
largeTitle: true,
child: VisualizeWidthAndHeightWithConstraints(
arrowHeadSize: arrowHeadSize,
properties: propertiesLocal,
warnIfUnconstrained: false,
child: const SizedBox.shrink(),
),
),
),
);
}
}

/// Widget that represents and visualize a direct child of Flex widget.
class BoxChildVisualizer extends StatelessWidget {
const BoxChildVisualizer({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ const overflowBackgroundColorLight = Color(0xFFB00020);
const overflowTextColorDark = Color(0xfff5846b);
const overflowTextColorLight = Color(0xffdea089);

const backgroundColorSelectedDark = Color(
0x4d474747,
); // TODO(jacobr): we would like Color(0x4dedeeef) but that makes the background show through.
const backgroundColorSelectedLight = Color(0x4dedeeef);

extension LayoutExplorerColorScheme on ColorScheme {
Color get mainAxisColor => isLight ? mainAxisLightColor : mainAxisDarkColor;

Expand All @@ -93,16 +88,10 @@ extension LayoutExplorerColorScheme on ColorScheme {
Color get overflowTextColor =>
isLight ? overflowTextColorLight : overflowTextColorDark;

Color get backgroundColorSelected =>
isLight ? backgroundColorSelectedLight : backgroundColorSelectedDark;

Color get unconstrainedColor =>
isLight ? unconstrainedLightColor : unconstrainedDarkColor;
}

const backgroundColorDark = Color(0xff30302f);
const backgroundColorLight = Color(0xffffffff);

const unconstrainedDarkColor = Color(0xffdea089);
const unconstrainedLightColor = Color(0xfff5846b);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class WidgetTheme {
class WidgetIcons {
static const root = 'icons/inspector/widget_icons/root.png';
static const text = 'icons/inspector/widget_icons/text.png';
static const icon = 'icons/inspector/widget_icons/icon.png';
static const image = 'icons/inspector/widget_icons/image.png';
static const floatingActionButton =
'icons/inspector/widget_icons/floatingab.png';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _WidgetDetailsState extends State<WidgetDetails> with AutoDisposeMixin {
);
}

return DetailsTable(controller: controller, node: node);
return DetailsTable(controller: controller);
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,11 @@ import '../layout_explorer/flex/flex.dart';
/// Table for the widget's properties, along with its render object and a
/// flex layout explorer if the widget is part of a flex layout.
class DetailsTable extends StatefulWidget {
const DetailsTable({
super.key,
required this.controller,
required this.node,
this.extraTabs,
});
const DetailsTable({super.key, required this.controller});

static const gaPrefix = 'inspectorDetailsTable';

final InspectorController controller;
final RemoteDiagnosticsNode node;
final List<TabAndView>? extraTabs;

@override
State<DetailsTable> createState() => _DetailsTableState();
Expand All @@ -44,9 +37,6 @@ class _DetailsTableState extends State<DetailsTable> {
RemoteDiagnosticsNode? get selectedNode =>
widget.controller.selectedDiagnostic;

LayoutProperties? get layoutProperties =>
widget.controller.selectedNodeProperties.value.layoutProperties;

final _widgetPropertiesTab = DevToolsTab.create(
tabName: 'Widget properties',
gaPrefix: DetailsTable.gaPrefix,
Expand Down Expand Up @@ -269,7 +259,6 @@ class _PropertiesViewState extends State<PropertiesView> {
height: PropertiesView.layoutExplorerHeight,
width: PropertiesView.layoutExplorerWidth,
child: BoxLayoutExplorerWidget(
widget.controller,
selectedNode: selectedNode,
layoutProperties: widget.layoutProperties,
),
Expand Down
Loading
Loading