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
ReviewCommentsOverlayin Flutter applications. -
A NavigatorObserver that tracks the active Flutter route and notifies
ReviewCommentsOverlaywhenever 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, andSemanticsinsideroot, capped cleanly at 240 characters. -
collectVisibleTextSegments(
Element root) → List< String> -
Collects distinct visible text segments in paint order inside
rootwithout duplicating internalText->RichText/Semanticsnodes. -
describeFlutterWidgetType(
Widget widget) → String -
Returns an unminified, human-readable widget type name using
ischecks acrossmaterial_ui,cupertino_ui,flutter/widgets, and legacyflutter/material(preserving clean names even in dart2js-O4release builds) andruntimeTypefor 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
widgetwhen--track-widget-creationis enabled, returningnullfor framework/pub widgets or builds without creation tracking. -
formatFlutterSelector(
{required String widgetType, String? keyString}) → String -
Formats a stable Flutter widget selector (
flutter:<WidgetType>orflutter:<WidgetType>[key=<key>]). -
isFrameworkOrExternalCreationUri(
String rawUri) → bool -
Returns
truewhenrawUribelongs to the Dart/Flutter SDK, Material or Cupertino UI packages, pub cache, or internalreview_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, ororg-dartlang-app:///packages/my_app/foo.dart) into a repository-relative path such aslib/foo.dart. -
parseFlutterSelector(
String selector) → ({String? keyString, String widgetType})? -
Parses a
flutter:<WidgetType>[key=...]selector string.