Skip to content

Commit

Permalink
[deep link] add isRowHovered in column render (#6728)
Browse files Browse the repository at this point in the history
The last column in deep link table is a navigation column, when the row is hovered, the column content is an icon, otherwise it's empty.
  
<img width="1486" alt="WeChat23c7fe6bf78ef1ede95094d70f84523c" src="https://github.com/flutter/devtools/assets/108393416/7df8fed8-da9b-459f-a510-eeaff5d0ea42">

*List which issues are fixed by this PR.*

*Please add a note to `packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md` if your change requires release notes. Otherwise, add the 'release-notes-not-required' label to the PR.*

![build.yaml badge]

If you need help, consider asking for help on [Discord].

[build.yaml badge]: https://github.com/flutter/devtools/actions/workflows/build.yaml/badge.svg
  • Loading branch information
hannah-hyj authored Nov 29, 2023
1 parent 8138c72 commit 7128fe0
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class _DataTable extends StatelessWidget {
controller.selectLink(linkdata!);
controller.updateDisplayOptions(showSplitScreen: true);
},
enableHoverHandling: true,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class DomainColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return _ErrorAwareText(
Expand Down Expand Up @@ -231,6 +232,7 @@ class PathColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return _ErrorAwareText(
Expand Down Expand Up @@ -302,6 +304,7 @@ class SchemeColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Text(getValue(dataObject));
Expand Down Expand Up @@ -347,6 +350,7 @@ class OSColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Text(getValue(dataObject));
Expand Down Expand Up @@ -415,6 +419,7 @@ class StatusColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (dataObject.domainErrors.isNotEmpty || dataObject.pathError) {
Expand All @@ -433,7 +438,6 @@ class StatusColumn extends ColumnData<LinkData>
}
}

// TODO: Implement this column.
class NavigationColumn extends ColumnData<LinkData>
implements ColumnRenderer<LinkData> {
NavigationColumn()
Expand All @@ -450,9 +454,12 @@ class NavigationColumn extends ColumnData<LinkData>
BuildContext context,
LinkData dataObject, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return const Icon(Icons.arrow_forward);
return isRowHovered
? const Icon(Icons.arrow_forward)
: const SizedBox.shrink();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class KindColumn extends ColumnData<LogData>
BuildContext context,
LogData item, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final String kind = item.kind;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class MessageColumn extends ColumnData<LogData>
BuildContext context,
LogData data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final textStyle = Theme.of(context).fixedFontStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class _ClassNameColumn extends ColumnData<DiffClassStats>
BuildContext context,
DiffClassStats data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
Expand Down Expand Up @@ -140,6 +141,7 @@ class _InstanceColumn extends ColumnData<DiffClassStats>
BuildContext context,
DiffClassStats 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 @@ -48,6 +48,7 @@ class _ClassNameColumn extends ColumnData<SingleClassStats>
BuildContext context,
SingleClassStats data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
Expand Down Expand Up @@ -96,6 +97,7 @@ class _InstanceColumn extends ColumnData<SingleClassStats>
BuildContext context,
SingleClassStats data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapInstanceTableCell(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class _FieldClassNameColumn extends ColumnData<ProfileRecord>
BuildContext context,
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.isTotal) return null;
Expand Down Expand Up @@ -137,6 +138,7 @@ class _FieldInstanceCountColumn extends ColumnData<ProfileRecord>
BuildContext context,
ProfileRecord data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return ProfileInstanceTableCell(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class _TraceCheckBoxColumn extends ColumnData<TracedClass>
BuildContext context,
TracedClass item, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Checkbox(
Expand Down Expand Up @@ -85,6 +86,7 @@ class _ClassNameColumn extends ColumnData<TracedClass>
BuildContext context,
TracedClass data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return HeapClassView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ class UriColumn extends ColumnData<NetworkRequest>
BuildContext context,
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final value = getDisplayValue(data);
Expand Down Expand Up @@ -460,6 +461,7 @@ class ActionsColumn extends ColumnData<NetworkRequest>
BuildContext context,
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final options = _buildOptions(data);
Expand Down Expand Up @@ -502,6 +504,7 @@ class StatusColumn extends ColumnData<NetworkRequest>
BuildContext context,
NetworkRequest data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final theme = Theme.of(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class MethodAndSourceColumn extends TreeColumnData<CpuStackFrame>
BuildContext context,
CpuStackFrame data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return MethodAndSourceDisplay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class _MethodColumn extends ColumnData<MethodTableGraphNode>
BuildContext context,
MethodTableGraphNode data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return MethodAndSourceDisplay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class _ObjectColumn extends ColumnData<ObjectStoreEntry>
// ignore: avoid-dynamic, requires refactor.
data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return VmServiceObjectLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class _FunctionsColumn extends _CodeColumnData<InliningEntry>
BuildContext context,
InliningEntry data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
return Row(
Expand Down Expand Up @@ -177,6 +178,7 @@ class _InstructionColumn extends _CodeColumnData<Instruction>
BuildContext context,
Instruction data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
final theme = Theme.of(context);
Expand Down Expand Up @@ -277,6 +279,7 @@ class _DartObjectColumn extends _CodeColumnData<Instruction>
BuildContext context,
Instruction data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.object == null) return Container();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class _DartObjectColumn extends _ObjectPoolColumnData
BuildContext context,
ObjectPoolEntry data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.value is int) return Text(data.value.toString());
Expand Down
Loading

0 comments on commit 7128fe0

Please sign in to comment.