rookie_yaml 0.5.0
rookie_yaml: ^0.5.0 copied to clipboard
A highly configurable parser and dumper for YAML (and optionally json).
example/main.dart
import 'package:rookie_yaml/src/parser/loaders/loader.dart';
void main(List<String> args) {
const yaml = '''
plain
---
"double quoted"
---
'single quoted'
---
> # Comment
folded
---
| # Comment
literal
---
flow: {
flow: map
flow: [sequence]
}
block:
block: map
block:
- sequence
''';
final docs = loadAllDocuments(YamlSource.string(yaml)); // Parse documents
// [parseNodes] maps the docs parsed as below.
print(docs.map((d) => d.root));
}