Skip to main content

semantic_tree_extension 1.1.0 copy "semantic_tree_extension: ^1.1.0" to clipboard
semantic_tree_extension: ^1.1.0 copied to clipboard

A Flutter DevTools extension to inspect and visualize the SemanticsTree in real time.

semantic_tree_extension #

A Flutter DevTools extension to inspect, audit, and visualize the SemanticsTree of a running Flutter application in real time.

Screenshots #

SemanticsTree Inspector & Widget Source Accessibility Audit, Quick Fixes & Live Highlight
SemanticsTree inspector with widget source location and geometry Accessibility audit, quick fix snippet, and live highlight overlay

Features #

  • Hybrid data source:
    • Structured JSON mode (recommended): Call SemanticTreeExtension.ensureInitialized() in main() to register ext.semantic_tree_extension.getSemanticsTree, automatically enable semantics on demand, and stream the full structured SemanticsNode tree.
    • Zero-config fallback mode: If ensureInitialized() is not called, the extension automatically falls back to Flutter's built-in ext.flutter.debugDumpSemanticsTreeInTraversalOrder service extension and parses the output.
  • Interactive Split-View UI:
    • Left pane: collapsible SemanticsTree with traversal order, node IDs, widget names, labels, and compact flag/action badges.
    • Right pane: detailed property inspector (label, value, hint, tooltip, globalRect, localRect, flags, actions, tags, textDirection) and widget source location.
  • Accessibility Audit & Quick Fixes:
    • Automatic detection of common accessibility issues (missing labels, small tap targets, duplicate interactive labels) with copyable Flutter quick-fix snippets.
  • Live Highlight Overlay & Traversal Order:
    • Highlight semantic nodes directly on the running app and switch between Traversal and Hit Test order, or Effective and Raw tree views.

Getting started #

  • Flutter SDK: >= 3.24.0
  • Dart SDK: ^3.12.2

Add semantic_tree_extension to your pubspec.yaml:

flutter pub add semantic_tree_extension

Or manually:

dependencies:
  semantic_tree_extension: ^1.0.0

Note: SemanticTreeExtension.ensureInitialized() is a no-op in release mode (kReleaseMode), so it is safe to leave in main().

Usage #

Optionally initialize the structured JSON service extension in main() to enable live on-device highlighting, widget source resolution, and automatic semantics activation:

import 'package:flutter/material.dart';
import 'package:semantic_tree_extension/semantic_tree_extension.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SemanticTreeExtension.ensureInitialized();
  runApp(const MyApp());
}

Then run your app in debug or profile mode and open the semantic_tree_extension tab in Flutter DevTools.

Additional information #

Development #

Rebuild and copy the DevTools extension web assets into extension/devtools/build/:

cd devtools_extension
dart run devtools_extensions build_and_copy --source=. --dest=../extension/devtools
dart run devtools_extensions validate --package=..
0
likes
150
points
104
downloads
screenshot

Documentation

API reference

Publisher

verified publishermaxbarroy.dev

Weekly Downloads

A Flutter DevTools extension to inspect and visualize the SemanticsTree in real time.

Repository (GitHub)
View/report issues

Topics

#devtools #accessibility #semantics #flutter-devtools

License

MIT (license)

Dependencies

flutter

More

Packages that depend on semantic_tree_extension