yaml_fluency 1.0.0 copy "yaml_fluency: ^1.0.0" to clipboard
yaml_fluency: ^1.0.0 copied to clipboard

outdated

Write YAML using a fluent syntax. Supports the core types you'd expect, and can be extended easily.

YAML Fluency #

Writes YAML strings fluently

Write this:

final userWriter = YamlMapWriter()
  ..writeMap(
    'man',
    (man) => man
      ..writeString('email', 'scott@madewithfelt.com')
      ..writeString('displayName', 'shyndman', quoted: false)
      ..writeBool('activated', true)
      ..writeString('bio', stripLeadingSpace('''
        Ontario native, and dog whisperer.
        Programming Dart/Flutter these days.
      '''), multiline: true)
      ..writeMap(
        'account',
        (account) => account
          ..writeNumber('loginCount', 5)
          ..writeString(
            'ticket',
            Uuid().v4(),
          ),
      ),
  )
  ..writeMap(
    'dog',
    (dog) => dog
      ..writeString('name', 'Henry')
      ..writeNumber('weight (lbs)', 24.5)
      ..writeBool('awesome', true)
      ..writeString('bio', stripLeadingSpace('''
        California dog, coming to terms
        with the Canadian winter.
      '''), multiline: true),
  );

To get this:

man:
  email: "scott@madewithfelt.com"
  displayName: shyndman
  activated: true
  bio: |-
    Ontario native, and dog whisperer.
    Programming Dart/Flutter these days.
  account:
    loginCount: 5
    ticket: "d17933a8-4e24-4e66-9522-d59124f84503"
dog:
  name: "Henry"
  weight (lbs): 24.5
  awesome: true
  bio: |-
    California dog, coming to terms
    with the Canadian winter.
4
likes
0
pub points
0%
popularity

Publisher

verified publishermadewithfelt.com

Write YAML using a fluent syntax. Supports the core types you'd expect, and can be extended easily.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, pedantic

More

Packages that depend on yaml_fluency