yaml_extension

Creator: coderz1093

Last updated:

0 purchases

yaml_extension Image
yaml_extension Images
Add to Cart

Description:

yaml extension

The package extends the functionality of the yaml
library
Method list #



Method
Used for




toMap()
Allows you to convert text data in yaml format to Map<String, dynamic>



Getting started #
To use any functions of the package,
just install and import it.
Usage #
Below are example of transformations of
pubspec.yaml file of this package
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();
copied to clipboard
YamlMap creation:
YamlMap yamlSets = loadYaml(utf8.decode(bytes));
copied to clipboard
Convert YamlMap to Map:
final map = yamlSets.toMap();
copied to clipboard
Transformation of Map into a human-readable form.
This feature is implemented in toStructuredString()
method of 'object_extension' package:
final structuredString = map.toStructuredString();
copied to clipboard
Print result:
print('\n$structuredString');
copied to clipboard
Output:
{
name: 'yaml_extension',
description: 'The package provides functions to simplify the work with yaml files.',
version: '1.0.1',
repository: 'https://github.com/iLnaar/yaml_extension',
environment: {
sdk: '>=2.14.4 <3.0.0'
},
dev_dependencies: {
lints: '^1.0.0',
test: '^1.16.0'
},
dependencies: {
object_extension: '^1.0.2',
yaml: '^3.1.0'
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.