You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Dart conditional import/export links only the default URI, dropping the platform implementation #4002
produces a single exports edge to service_stub.dart; there is no edge to service_io.dart.
This is the standard Flutter facade pattern for platform-specific code, and the stub is usually an empty placeholder while the real implementation lives in the if branch. As a result the implementation file becomes unreachable through the facade: everything that imports service.dart appears to depend only on the stub, and explain/path on the implementation file see no link from the facade or its importers.
Expected: one edge per URI in the directive - the default one plus each conditional alternative (service_stub.dart and service_io.dart above). The same applies to conditional import directives.
Cause: both patterns in graphify/extractors/dart.py (section "6. Imports and Exports") match only the first quoted string after import/export:
r"""^\s*export\s+['"]([^'"]+)['"]"""
Note that a condition may itself contain a string literal (if (app.flavor == 'prod') 'flags_prod.dart'), so a naive "all quoted strings in the directive" approach would mint a bogus prod node.
Steps to reproduce
mkdir -p repro/lib &&cd repro
printf"export 'service_stub.dart'\n if (dart.library.io) 'service_io.dart';\n"> lib/service.dart
printf"class Service {}\n"> lib/service_stub.dart
printf"class Service {\n void connect() {}\n}\n"> lib/service_io.dart
python - <<'PY'from pathlib import Pathfrom graphify.extract import extract_dartfor e in extract_dart(Path("lib/service.dart"))["edges"]: print(e["relation"], "->", e["target"])PY
On a real Flutter app (~300 Dart files) all four such facades in the project were affected: the graph had no edge from any facade to its *_io.dart implementation.
Graphify version
0.9.73 (reproduced on v8 @ e10df08 / 0.9.74 as well - the Dart extractor is unchanged there)
Operating System
macOS
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
No provider environment variables are needed - this is pure AST/regex extraction. Reproduced from a clean checkout of v8.
Activity
github-actions commentedon Oct 2, 2026
Thanks for opening this issue, @brlumen. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(dart): link every URI of a configurable import/export (#4002)
safishamsi commentedon Oct 4, 2026
Fixed in v0.9.75 (live on PyPI as
graphifyy==0.9.75) via #4003, thanks @brlumen. 🙏