flutter_2yaml library

Convert Flutter .dart widget files into compact YAML representations optimized for LLM/AI token consumption.

This package provides both a CLI tool and a programmatic API for bidirectional conversion between Flutter widget files (.dart) and structured YAML format with CSS-like shorthands, pipe syntax, arrow callback notation, and configurable verbosity levels.

Classes

ConstructorParam
Represents a constructor parameter.
Converter
Orchestrates the full conversion pipeline: read .dart → analyze → generate YAML → write .yaml.
DartFileAnalyzer
Analyzes a Flutter .dart file and produces a DartFileModel.
DartFileModel
Complete parsed representation of a Flutter .dart widget file.
DartGenerator
Generates idiomatic Flutter Dart source code from a DartFileModel.
MethodSummary
Represents a lifecycle or custom method in the State class.
ReverseConverter
Orchestrates the reverse conversion pipeline: read .yaml → parse → generate → write .dart.
StateManagementInfo
Detected state management pattern information.
StateModel
Aggregated state information for a StatefulWidget's State class.
StateVariable
Represents a state variable declared in a StatefulWidget's State class.
WidgetNode
Represents a single widget in the Flutter widget tree.
YamlGenerator
Generates compact YAML in the Unified Format from a DartFileModel.
YamlParser
Parses a Unified Compact Format YAML string into a DartFileModel.

Enums

VerbosityLevel
The verbosity level for YAML output generation.
WidgetType
The type of Flutter widget class detected in the .dart file.