Skip to content

Commit 941b480

Browse files
authored
Use SelectionArea instead of SelectableText (#9333)
1 parent 896c500 commit 941b480

File tree

28 files changed

+205
-206
lines changed

28 files changed

+205
-206
lines changed

packages/devtools_app/lib/src/framework/scaffold/about_dialog.dart

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,50 @@ class DevToolsAboutDialog extends StatelessWidget {
2424
final theme = Theme.of(context);
2525
return DevToolsDialog(
2626
title: const DialogTitleText('About DevTools'),
27-
content: Column(
28-
mainAxisSize: MainAxisSize.min,
29-
crossAxisAlignment: CrossAxisAlignment.start,
30-
children: [
31-
Wrap(
32-
children: [
33-
SelectableText('DevTools version $devToolsVersion'),
34-
const Text(' - '),
35-
InkWell(
36-
child: Text('release notes', style: theme.linkTextStyle),
37-
onTap: () =>
38-
unawaited(releaseNotesController.openLatestReleaseNotes()),
39-
),
40-
],
41-
),
42-
const SizedBox(height: denseSpacing),
43-
const Wrap(
44-
children: [
45-
Text('Encountered an issue? Let us know at '),
46-
_FeedbackLink(),
47-
Text('.'),
48-
],
49-
),
50-
const SizedBox(height: defaultSpacing),
51-
...dialogSubHeader(theme, 'Contributing'),
52-
const Wrap(
53-
children: [
54-
Text('Want to contribute to DevTools? Please see our '),
55-
_ContributingLink(),
56-
Text(' guide, or '),
57-
],
58-
),
59-
const Wrap(
60-
children: [Text('connect with us on '), _DiscordLink(), Text('.')],
61-
),
62-
],
27+
content: SelectionArea(
28+
child: Column(
29+
mainAxisSize: MainAxisSize.min,
30+
crossAxisAlignment: CrossAxisAlignment.start,
31+
children: [
32+
Wrap(
33+
children: [
34+
Text('DevTools version $devToolsVersion'),
35+
const Text(' - '),
36+
InkWell(
37+
child: Text('release notes', style: theme.linkTextStyle),
38+
onTap: () => unawaited(
39+
releaseNotesController.openLatestReleaseNotes(),
40+
),
41+
),
42+
],
43+
),
44+
const SizedBox(height: denseSpacing),
45+
const Wrap(
46+
children: [
47+
Text('Encountered an issue? Let us know at '),
48+
_FeedbackLink(),
49+
Text('.'),
50+
],
51+
),
52+
const SizedBox(height: defaultSpacing),
53+
...dialogSubHeader(theme, 'Contributing'),
54+
const Wrap(
55+
children: [
56+
Text('Want to contribute to DevTools? Please see our '),
57+
_ContributingLink(),
58+
Text(' guide, or '),
59+
],
60+
),
61+
62+
const Wrap(
63+
children: [
64+
Text('connect with us on '),
65+
_DiscordLink(),
66+
Text('.'),
67+
],
68+
),
69+
],
70+
),
6371
),
6472
actions: const [DialogLicenseButton(), DialogCloseButton()],
6573
);

packages/devtools_app/lib/src/screens/deep_link_validation/deep_links_model.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ class DomainColumn extends ColumnData<LinkData>
586586
LinkData dataObject, {
587587
bool isRowSelected = false,
588588
bool isRowHovered = false,
589-
VoidCallback? onPressed,
590589
}) {
591590
return dataObject.domain == null
592591
? Text('missing domain', style: Theme.of(context).errorTextStyle)
@@ -648,7 +647,6 @@ class PathColumn extends ColumnData<LinkData>
648647
LinkData dataObject, {
649648
bool isRowSelected = false,
650649
bool isRowHovered = false,
651-
VoidCallback? onPressed,
652650
}) {
653651
return _ErrorAwareText(
654652
isError: dataObject.pathErrors.isNotEmpty,
@@ -730,7 +728,6 @@ class SchemeColumn extends ColumnData<LinkData>
730728
LinkData dataObject, {
731729
bool isRowSelected = false,
732730
bool isRowHovered = false,
733-
VoidCallback? onPressed,
734731
}) {
735732
return dataObject.scheme.isEmpty
736733
? Text(missingScheme, style: Theme.of(context).errorTextStyle)
@@ -782,7 +779,6 @@ class OSColumn extends ColumnData<LinkData>
782779
LinkData dataObject, {
783780
bool isRowSelected = false,
784781
bool isRowHovered = false,
785-
VoidCallback? onPressed,
786782
}) {
787783
return Text(getValue(dataObject));
788784
}
@@ -855,7 +851,6 @@ class StatusColumn extends ColumnData<LinkData>
855851
LinkData dataObject, {
856852
bool isRowSelected = false,
857853
bool isRowHovered = false,
858-
VoidCallback? onPressed,
859854
}) {
860855
if (dataObject.domainErrors.isNotEmpty ||
861856
dataObject.pathErrors.isNotEmpty) {
@@ -890,7 +885,6 @@ class NavigationColumn extends ColumnData<LinkData>
890885
LinkData dataObject, {
891886
bool isRowSelected = false,
892887
bool isRowHovered = false,
893-
VoidCallback? onPressed,
894888
}) {
895889
return isRowHovered
896890
? const Icon(Icons.arrow_forward)

packages/devtools_app/lib/src/screens/logging/_log_details.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ class _LogDetailsState extends State<LogDetails>
9292
(log?.encodedDetails ?? '').isEmpty
9393
? Padding(
9494
padding: const EdgeInsets.all(denseSpacing),
95-
child: SelectableText(
96-
log?.prettyPrinted() ?? '',
97-
textAlign: TextAlign.left,
95+
child: SelectionArea(
96+
child: Text(
97+
log?.prettyPrinted() ?? '',
98+
textAlign: TextAlign.left,
99+
),
98100
),
99101
)
100102
: JsonViewer(encodedJson: log!.encodedDetails),

packages/devtools_app/lib/src/screens/logging/_message_column.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class MessageColumn extends ColumnData<LogData>
4848
LogData data, {
4949
bool isRowSelected = false,
5050
bool isRowHovered = false,
51-
VoidCallback? onPressed,
5251
}) {
5352
final theme = Theme.of(context);
5453
final hasSummary = !data.summary.isNullOrEmpty;

packages/devtools_app/lib/src/screens/memory/panes/diff/widgets/classes_table_diff.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class _ClassNameColumn extends ColumnData<DiffClassData>
4848
DiffClassData data, {
4949
bool isRowSelected = false,
5050
bool isRowHovered = false,
51-
VoidCallback? onPressed,
5251
}) {
5352
return HeapClassView(
5453
theClass: data.className,
@@ -132,7 +131,6 @@ class _InstanceColumn extends ColumnData<DiffClassData>
132131
DiffClassData data, {
133132
bool isRowSelected = false,
134133
bool isRowHovered = false,
135-
VoidCallback? onPressed,
136134
}) {
137135
final objects = _instances(data);
138136

packages/devtools_app/lib/src/screens/memory/panes/diff/widgets/classes_table_single.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class _ClassNameColumn extends ColumnData<SingleClassData>
4545
SingleClassData data, {
4646
bool isRowSelected = false,
4747
bool isRowHovered = false,
48-
VoidCallback? onPressed,
4948
}) {
5049
return HeapClassView(
5150
theClass: data.className,
@@ -94,7 +93,6 @@ class _InstanceColumn extends ColumnData<SingleClassData>
9493
SingleClassData data, {
9594
bool isRowSelected = false,
9695
bool isRowHovered = false,
97-
VoidCallback? onPressed,
9896
}) {
9997
return HeapInstanceTableCell(
10098
data.objects,

packages/devtools_app/lib/src/screens/memory/panes/profile/profile_view.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class _FieldClassNameColumn extends ColumnData<ProfileRecord>
5454
ProfileRecord data, {
5555
bool isRowSelected = false,
5656
bool isRowHovered = false,
57-
VoidCallback? onPressed,
5857
}) {
5958
if (data.isTotal) return null;
6059

@@ -134,7 +133,6 @@ class _FieldInstanceCountColumn extends ColumnData<ProfileRecord>
134133
ProfileRecord data, {
135134
bool isRowSelected = false,
136135
bool isRowHovered = false,
137-
VoidCallback? onPressed,
138136
}) {
139137
return ProfileInstanceTableCell(
140138
data.heapClass,

packages/devtools_app/lib/src/screens/memory/panes/tracing/class_table.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class _TraceCheckBoxColumn extends ColumnData<TracedClass>
4242
TracedClass item, {
4343
bool isRowSelected = false,
4444
bool isRowHovered = false,
45-
VoidCallback? onPressed,
4645
}) {
4746
return Checkbox(
4847
value: item.traceAllocations,
@@ -86,7 +85,6 @@ class _ClassNameColumn extends ColumnData<TracedClass>
8685
TracedClass data, {
8786
bool isRowSelected = false,
8887
bool isRowHovered = false,
89-
VoidCallback? onPressed,
9088
}) {
9189
return HeapClassView(
9290
theClass: data.name,

packages/devtools_app/lib/src/screens/network/network_screen.dart

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,12 @@ class AddressColumn extends ColumnData<NetworkRequest>
379379
NetworkRequest data, {
380380
bool isRowSelected = false,
381381
bool isRowHovered = false,
382-
VoidCallback? onPressed,
383382
}) {
384383
final value = getDisplayValue(data);
385-
386-
return SelectableText(
384+
return Text(
387385
value,
388386
maxLines: 1,
389387
style: const TextStyle(overflow: TextOverflow.ellipsis),
390-
// [onPressed] needs to be passed along to [SelectableText] so that a
391-
// click on the text will still trigger the [onPressed] action for the
392-
// row.
393-
onTap: onPressed,
394388
);
395389
}
396390
}
@@ -426,7 +420,6 @@ class ActionsColumn extends ColumnData<NetworkRequest>
426420
NetworkRequest data, {
427421
bool isRowSelected = false,
428422
bool isRowHovered = false,
429-
VoidCallback? onPressed,
430423
}) {
431424
// Only show the actions button when there are options and the row is
432425
// currently selected.
@@ -489,7 +482,6 @@ class StatusColumn extends ColumnData<NetworkRequest>
489482
NetworkRequest data, {
490483
bool isRowSelected = false,
491484
bool isRowHovered = false,
492-
VoidCallback? onPressed,
493485
}) {
494486
final theme = Theme.of(context);
495487
return Text(

packages/devtools_app/lib/src/screens/profiler/panes/cpu_profile_columns.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class MethodAndSourceColumn extends TreeColumnData<CpuStackFrame>
5858
CpuStackFrame data, {
5959
bool isRowSelected = false,
6060
bool isRowHovered = false,
61-
VoidCallback? onPressed,
6261
}) {
6362
return MethodAndSourceDisplay(
6463
methodName: data.name,

0 commit comments

Comments
 (0)