review_comments_flutter library

First-class visual highlight, local coding-agent feedback, and GitHub PR diff comment overlay for Flutter Web apps.

Uses conditional multi-platform exports so non-web Flutter targets (iOS, Android, macOS, Windows, Linux, and VM flutter test) compile cleanly with zero web dependencies and zero runtime overhead.

Classes

FlutterInspectedArea
Region inspection payload returned by adapter.inspectArea(rect).
FlutterInspectedPoint
Hit-test inspection payload returned by adapter.inspectPoint(x, y).
FlutterLocatedRect
Viewport bounding rectangle in CSS / logical pixels.
FlutterPageContext
Active route and source file metadata returned by adapter.getPageContext().
FlutterWidgetTreeInspector
Live Flutter Element and RenderBox tree inspector bridging Flutter's widget hierarchy to the review overlay.
ReviewCommentsConfig
Configuration and activation safety gate for ReviewCommentsOverlay in Flutter applications.
ReviewCommentsNavigatorObserver
A NavigatorObserver that tracks the active Flutter route and notifies ReviewCommentsOverlay whenever navigation occurs.
ReviewCommentsOverlay
Wraps a Flutter application or route subtree to enable visual highlighting, local coding-agent feedback, and GitHub PR review comments on Flutter Web.
ReviewConfig
Configuration for the visual review and GitHub PR comment overlay.
WidgetSourceLocation
Normalized user-code creation location extracted from a Widget.

Functions

collectVisibleText(Element root) → String
Collects normalized visible text strings from Text, RichText, SelectableText, EditableText, Tooltip, and Semantics inside root, capped cleanly at 240 characters.
collectVisibleTextSegments(Element root) → List<String>
Collects distinct visible text segments in paint order inside root without duplicating internal Text -> RichText / Semantics nodes.
describeFlutterWidgetType(Widget widget) → String
Returns an unminified, human-readable widget type name using is checks across material_ui, cupertino_ui, flutter/widgets, and legacy flutter/material (preserving clean names even in dart2js -O4 release builds) and runtimeType for custom user widgets.
extractFlutterWidgetKey(Key? key) → String?
Extracts a clean human-readable key identifier from key, ignoring private framework keys.
extractWidgetSourceLocation(Widget widget) → WidgetSourceLocation?
Extracts the user-authored WidgetSourceLocation of widget when --track-widget-creation is enabled, returning null for framework/pub widgets or builds without creation tracking.
formatFlutterSelector({required String widgetType, String? keyString}) → String
Formats a stable Flutter widget selector (flutter:<WidgetType> or flutter:<WidgetType>[key=<key>]).
isFrameworkOrExternalCreationUri(String rawUri) → bool
Returns true when rawUri belongs to the Dart/Flutter SDK, Material or Cupertino UI packages, pub cache, or internal review_comments_* library code rather than the user's app.
normalizeFlutterRoutePath(String? rawRoute) → String
Normalizes a Flutter route name, pathname, or hash fragment (such as '#/details?tab=1' or '/details/') into a clean path starting with '/'.
normalizeWidgetSourceFile(String rawUri) → String
Normalizes a Dart widget creation URI (file:///.../lib/foo.dart, package:my_app/foo.dart, or org-dartlang-app:///packages/my_app/foo.dart) into a repository-relative path such as lib/foo.dart.
parseFlutterSelector(String selector) → ({String? keyString, String widgetType})?
Parses a flutter:<WidgetType>[key=...] selector string.