dart_source_graph 0.1.2 copy "dart_source_graph: ^0.1.2" to clipboard
dart_source_graph: ^0.1.2 copied to clipboard

Generates a semantic dependency graph of Dart/Flutter source code. Identifies Widgets, Notifiers, Blocs and Controllers with confidence-rated edges. Designed for AI-assisted codebase analysis and arch [...]

example/example.dart

// example/example.dart
//
// Uso básico de dart_source_graph.
// Analiza el proyecto actual y genera un grafo de código fuente.

import 'package:dart_source_graph/dart_source_graph.dart';
import 'package:dart_source_graph/viewer.dart';

Future<void> main() async {
  // Análisis mínimo — sin config, cero dependencias externas.
  final graph = await SourceGraphAnalyzer().analyze('.');
  print('Nodes: ${graph.nodes.length}, Edges: ${graph.edges.length}');

  // Con capas arquitectónicas y resolución semántica.
  final graphWithLayers = await SourceGraphAnalyzer(
    config: SourceGraphConfig(
      layers: [
        LayerConfig(name: 'core', paths: ['lib/src/core/']),
        LayerConfig(name: 'adapters', paths: ['lib/src/adapters/']),
      ],
    ),
  ).analyze('.', resolve: true);

  // Generar reporte Markdown.
  final meta = CodeGraphMeta(
    schemaVersion: '1.0.0',
    package: 'my_app',
    generatedAt: DateTime.now().toUtc().toIso8601String(),
    inputsFingerprint: 'sha256:example',
    root: '.',
  );
  final report = generateReport(graphWithLayers, meta);
  print(report.substring(0, 200));

  // Generar visor HTML autocontenido.
  final htmlPath = writeHtmlViewer(
    graph: graphWithLayers,
    meta: meta,
    outputDir: '.',
  );
  print('Viewer: $htmlPath');
}
0
likes
150
points
60
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Generates a semantic dependency graph of Dart/Flutter source code. Identifies Widgets, Notifiers, Blocs and Controllers with confidence-rated edges. Designed for AI-assisted codebase analysis and architecture audits.

Repository (GitHub)
View/report issues

Topics

#dart #flutter #static-analysis #ast #graph

License

BSD-3-Clause (license)

Dependencies

analyzer, args, crypto, path, yaml

More

Packages that depend on dart_source_graph