diff --git a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/box/box.dart b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/box/box.dart index d8cf68d744c..b98eed6b635 100644 --- a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/box/box.dart +++ b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/box/box.dart @@ -87,7 +87,16 @@ class BoxLayoutExplorerWidgetState extends LayoutExplorerWidgetState< @override Widget build(BuildContext context) { - if (properties == null) return const SizedBox(); + if (properties == null) { + final selectedNodeLocal = selectedNode; + return Center( + child: Text( + '${selectedNodeLocal?.description ?? 'Widget'} has no layout properties to display.', + textAlign: TextAlign.center, + overflow: TextOverflow.clip, + ), + ); + } return Container( margin: const EdgeInsets.all(margin), padding: const EdgeInsets.only(bottom: margin, right: margin), diff --git a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/layout_explorer_widget.dart b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/layout_explorer_widget.dart index 1781a701d3e..3c59dee52a1 100644 --- a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/layout_explorer_widget.dart +++ b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/layout_explorer_widget.dart @@ -78,9 +78,7 @@ abstract class LayoutExplorerWidgetState