Skip to content
pubscout

yaml

3.1.4, released 3 months ago by tools.dart.dev

A Dart library for parsing YAML documents into Dart data structures.

WASM-readyRock solid
$ flutter pub add yaml
Source repository

What it does

Provides functions to load YAML strings or streams into Dart objects. It supports error recovery and detailed error reporting. The library does not support dumping YAML back to text.

AI-written summary of version 3.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Parsing configuration files in Dart or Flutter apps
  • Converting YAML data to Dart maps/lists for further processing
  • Reading YAML from network or local files

Skip it when

  • When you need to generate YAML output
  • When working with very large YAML files that require streaming parsing

Strengths

  • Pure Dart implementation, no native dependencies
  • Supports error recovery with custom listeners
  • Maintained by dart-lang with regular updates
  • Compatible with all platforms (web, mobile, desktop)

Weaknesses

  • No YAML dumping support
  • Limited to parsing, not editing or serializing
  • Some edge cases (self-referential collections) still throw exceptions

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3
import 'package:yaml/yaml.dart';

void main() {
  var doc = loadYaml('YAML: YAML Ain\'t Markup Language');
  print(doc['YAML']);
}

Alternatives

Packages that do the same job and could replace yaml.

  • csv_plus

    Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.

  • conduit_codable

    A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.

  • plist_parser

    Flutter plugin for parsing XML and binary Apple property list (plist) formats.

  • binary_codec

    Dart library for converting standard data types to a binary format and back

Works with

Packages commonly used together with yaml: ones it builds on, ones built on it, and its own family.