Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Feature Request: Search widget tree by error chain path

Đang mở
#10,012 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart

Hướng nghiên cứu

Start with the Inspector's existing search bar and widget-tree search behavior. Trace how a single widget name is matched, then determine how the tree can support ancestor-chain parsing with ← or ◂ separators and partial matching. Done means the example chain locates the matching node or nodes, highlights them, and scrolls the Inspector to the result.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When a layout error occurs (e.g., RenderFlex overflowed), Flutter prints a widget ancestor chain like:

SizedBox ← Flexible ← Stack ← Row ← Padding ← DecoratedBox ← ConstrainedBox ← Container

Currently, there is no way to paste this chain into DevTools to locate the exact widget node in the Inspector tree. The existing search only matches a single widget name, which returns dozens of results for common widgets like SizedBox or Padding.

Proposed Solution

Add a "Search by widget chain" mode in the Inspector's search bar that:

Accepts a widget ancestor chain (using ← or ◂ as separators, matching Flutter's error output format)
Walks the widget tree and finds nodes whose ancestor path matches the given chain
Highlights and scrolls to the matching node(s)
Example

Given this error output:

SizedBox ← Flexible ← Stack ← Row

The search would find SizedBox nodes that have Flexible as parent, then Stack, then Row — and jump to the matching location in the tree.

Why This Is Useful
Direct error-to-inspector workflow: Copy the chain from the error console → paste into DevTools → land on the exact widget. No manual tree navigation needed.
Eliminates ambiguity: Searching for SizedBox alone may return 50+ results. The chain narrows it to the exact instance.
Partial matching: The chain from the error is often a subset of the full tree. The algorithm should support subsequence matching (the chain nodes appear in order but not necessarily adjacent in the full tree).
Additional Context
The widget chain format is already standardized in Flutter's error output, so no new format needs to be invented.
This could be a separate search mode (e.g., toggled by a button next to the search bar, or auto-detected when ← is present in the query).
The chain in errors sometimes includes RenderObject names — the search could optionally strip or ignore those.
Contribution

I'm interested in implementing this feature. Happy to be assigned and submit a PR if the team approves the approach.

Ngôn ngữ chính
Dart
Star
1.7k
Fork
405
Merge trung bình
4 ngày 21 giờ
Pull request đã merge (30 ngày)
15

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của flutter/devtools

Tất cả issue của flutter/devtools

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.