yaml_extension 1.0.2 copy "yaml_extension: ^1.0.2" to clipboard
yaml_extension: ^1.0.2 copied to clipboard

The package provides functions to simplify the work with yaml files.

example/example.dart

import 'dart:convert';
import 'dart:io';
import 'package:object_extension/object_extension.dart';
import 'package:yaml/yaml.dart';
import 'package:yaml_extension/yaml_extension.dart';

///
/// toMap() example
///
void toMap() {
  /// Load 'pubspec.yaml' file of this package as example
  final file = File('pubspec.yaml');
  final reader = file.openSync(mode: FileMode.read);
  final bytes = reader.readSync(file.lengthSync());
  reader.closeSync();

  /// YamlMap creation
  YamlMap yamlSets = loadYaml(utf8.decode(bytes));

  /// Convert YamlMap to Map
  final map = yamlSets.toMap();

  /// Transformation of Map into a human-readable form
  /// This feature is implemented in the 'object_extension' package
  final structuredString = map.toStructuredString();

  /// Print result
  print('\n$structuredString');
}

///
/// main()
///
void main() {
  toMap();
}
3
likes
150
pub points
18%
popularity

Publisher

unverified uploader

The package provides functions to simplify the work with yaml files.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

object_extension, yaml

More

Packages that depend on yaml_extension