Skip to content
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

Use selectable text everywhere in Network page #3036

Merged
merged 3 commits into from
May 17, 2021
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 @@ -65,7 +65,7 @@ class HttpRequestHeadersView extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
SelectableText(
'$key: ',
style: Theme.of(context).textTheme.subtitle2,
),
Expand Down Expand Up @@ -228,14 +228,18 @@ class ImageResponseView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
SelectableText(
'$key: ',
style: Theme.of(context).textTheme.subtitle2,
),
Expanded(
child: Text(
child: SelectableText(
value,
overflow: TextOverflow.ellipsis,
// TODO(kenz): use top level overflow parameter if
// https://github.com/flutter/flutter/issues/82722 is fixed.
// TODO(kenz): add overflow after flutter 2.3.0 is stable. It was
// added in commit 65388ee2eeaf0d2cf087eaa4a325e3689020c46a.
// style: const TextStyle(overflow: TextOverflow.ellipsis),
),
),
],
Expand Down Expand Up @@ -275,7 +279,7 @@ class HttpRequestCookiesView extends StatelessWidget {
);
}

DataCell _buildCell(String value) => DataCell(Text(value ?? '--'));
DataCell _buildCell(String value) => DataCell(SelectableText(value ?? '--'));

DataCell _buildIconCell(IconData icon) =>
DataCell(Icon(icon, size: defaultIconSize));
Expand All @@ -295,10 +299,16 @@ class HttpRequestCookiesView extends StatelessWidget {
}) {
return DataColumn(
label: Expanded(
child: Text(
child: SelectableText(
title ?? '--',
// TODO(kenz): use top level overflow parameter if
// https://github.com/flutter/flutter/issues/82722 is fixed.
// TODO(kenz): add overflow after flutter 2.3.0 is stable. It was
// added in commit 65388ee2eeaf0d2cf087eaa4a325e3689020c46a.
// style: theme.textTheme.subtitle1.copyWith(
// overflow: TextOverflow.fade,
// ),
style: theme.textTheme.subtitle1,
overflow: TextOverflow.fade,
),
),
numeric: numeric,
Expand Down Expand Up @@ -652,7 +662,7 @@ class NetworkRequestOverviewView extends StatelessWidget {
children: [
Container(
width: _keyWidth,
child: Text(
child: SelectableText(
title != null ? '$title: ' : '',
style: Theme.of(context).textTheme.subtitle2,
),
Expand Down
6 changes: 4 additions & 2 deletions packages/devtools_app/lib/src/network/network_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,12 @@ class UriColumn extends ColumnData<NetworkRequest>
return Tooltip(
message: value,
waitDuration: tooltipWait,
child: Text(
child: SelectableText(
value,
maxLines: 1,
overflow: TextOverflow.ellipsis,
// TODO(kenz): add overflow after flutter 2.3.0 is stable. It was
// added in commit 65388ee2eeaf0d2cf087eaa4a325e3689020c46a.
// style: const TextStyle(overflow: TextOverflow.ellipsis),
),
);
}
Expand Down