Skip to content

Use SelectionArea instead of SelectableText #9333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,50 @@ class DevToolsAboutDialog extends StatelessWidget {
final theme = Theme.of(context);
return DevToolsDialog(
title: const DialogTitleText('About DevTools'),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
SelectableText('DevTools version $devToolsVersion'),
const Text(' - '),
InkWell(
child: Text('release notes', style: theme.linkTextStyle),
onTap: () =>
unawaited(releaseNotesController.openLatestReleaseNotes()),
),
],
),
const SizedBox(height: denseSpacing),
const Wrap(
children: [
Text('Encountered an issue? Let us know at '),
_FeedbackLink(),
Text('.'),
],
),
const SizedBox(height: defaultSpacing),
...dialogSubHeader(theme, 'Contributing'),
const Wrap(
children: [
Text('Want to contribute to DevTools? Please see our '),
_ContributingLink(),
Text(' guide, or '),
],
),
const Wrap(
children: [Text('connect with us on '), _DiscordLink(), Text('.')],
),
],
content: SelectionArea(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
Text('DevTools version $devToolsVersion'),
const Text(' - '),
InkWell(
child: Text('release notes', style: theme.linkTextStyle),
onTap: () => unawaited(
releaseNotesController.openLatestReleaseNotes(),
),
),
],
),
const SizedBox(height: denseSpacing),
const Wrap(
children: [
Text('Encountered an issue? Let us know at '),
_FeedbackLink(),
Text('.'),
],
),
const SizedBox(height: defaultSpacing),
...dialogSubHeader(theme, 'Contributing'),
const Wrap(
children: [
Text('Want to contribute to DevTools? Please see our '),
_ContributingLink(),
Text(' guide, or '),
],
),

const Wrap(
children: [
Text('connect with us on '),
_DiscordLink(),
Text('.'),
],
),
],
),
),
actions: const [DialogLicenseButton(), DialogCloseButton()],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ class DomainColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return dataObject.domain == null
? Text('missing domain', style: Theme.of(context).errorTextStyle)
Expand Down Expand Up @@ -648,7 +647,6 @@ class PathColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return _ErrorAwareText(
isError: dataObject.pathErrors.isNotEmpty,
Expand Down Expand Up @@ -728,7 +726,6 @@ class SchemeColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return dataObject.scheme.isEmpty
? Text(missingScheme, style: Theme.of(context).errorTextStyle)
Expand Down Expand Up @@ -780,7 +777,6 @@ class OSColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Text(getValue(dataObject));
}
Expand Down Expand Up @@ -853,7 +849,6 @@ class StatusColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (dataObject.domainErrors.isNotEmpty ||
dataObject.pathErrors.isNotEmpty) {
Expand Down Expand Up @@ -888,7 +883,6 @@ class NavigationColumn extends ColumnData<LinkData>
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return isRowHovered
? const Icon(Icons.arrow_forward)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ class _LogDetailsState extends State<LogDetails>
(log?.encodedDetails ?? '').isEmpty
? Padding(
padding: const EdgeInsets.all(denseSpacing),
child: SelectableText(
log?.prettyPrinted() ?? '',
textAlign: TextAlign.left,
child: SelectionArea(
child: Text(
log?.prettyPrinted() ?? '',
textAlign: TextAlign.left,
),
),
)
: JsonViewer(encodedJson: log!.encodedDetails),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class MessageColumn extends ColumnData<LogData>
LogData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final theme = Theme.of(context);
final hasSummary = !data.summary.isNullOrEmpty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class _ClassNameColumn extends ColumnData<DiffClassData>
DiffClassData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
theClass: data.className,
Expand Down Expand Up @@ -132,7 +131,6 @@ class _InstanceColumn extends ColumnData<DiffClassData>
DiffClassData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final objects = _instances(data);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class _ClassNameColumn extends ColumnData<SingleClassData>
SingleClassData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
theClass: data.className,
Expand Down Expand Up @@ -94,7 +93,6 @@ class _InstanceColumn extends ColumnData<SingleClassData>
SingleClassData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapInstanceTableCell(
data.objects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class _FieldClassNameColumn extends ColumnData<ProfileRecord>
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.isTotal) return null;

Expand Down Expand Up @@ -134,7 +133,6 @@ class _FieldInstanceCountColumn extends ColumnData<ProfileRecord>
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return ProfileInstanceTableCell(
data.heapClass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class _TraceCheckBoxColumn extends ColumnData<TracedClass>
TracedClass item, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Checkbox(
value: item.traceAllocations,
Expand Down Expand Up @@ -86,7 +85,6 @@ class _ClassNameColumn extends ColumnData<TracedClass>
TracedClass data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
theClass: data.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,12 @@ class AddressColumn extends ColumnData<NetworkRequest>
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final value = getDisplayValue(data);

return SelectableText(
return Text(
value,
maxLines: 1,
style: const TextStyle(overflow: TextOverflow.ellipsis),
// [onPressed] needs to be passed along to [SelectableText] so that a
// click on the text will still trigger the [onPressed] action for the
// row.
onTap: onPressed,
);
}
}
Expand Down Expand Up @@ -426,7 +420,6 @@ class ActionsColumn extends ColumnData<NetworkRequest>
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
// Only show the actions button when there are options and the row is
// currently selected.
Expand Down Expand Up @@ -489,7 +482,6 @@ class StatusColumn extends ColumnData<NetworkRequest>
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final theme = Theme.of(context);
return Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class MethodAndSourceColumn extends TreeColumnData<CpuStackFrame>
CpuStackFrame data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return MethodAndSourceDisplay(
methodName: data.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ class _MethodColumn extends ColumnData<MethodTableGraphNode>
MethodTableGraphNode data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return MethodAndSourceDisplay(
methodName: data.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class _ObjectColumn extends ColumnData<ObjectStoreEntry>
dynamic data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return VmServiceObjectLink(
// TODO(srawlins): What type is `data` at runtime? If cast to `int`, no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class _FunctionsColumn extends _CodeColumnData<InliningEntry>
InliningEntry data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Row(
children: [
Expand Down Expand Up @@ -165,7 +164,6 @@ class _InstructionColumn extends _CodeColumnData<Instruction>
Instruction data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final theme = Theme.of(context);
return Text.rich(
Expand Down Expand Up @@ -253,7 +251,6 @@ class _DartObjectColumn extends _CodeColumnData<Instruction>
Instruction data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.object == null) return Container();
return VmServiceObjectLink(
Expand Down
Loading
Loading