YamlUtils class

YAML/JSON Conversion Utilities for AssetX Configuration Processing.

Provides comprehensive utilities for converting YAML data structures to JSON-compatible Map and List objects that can be used with json_serializable generated classes. Essential for processing AssetX configuration files.

Key Features:

  • Deep conversion of nested YAML structures
  • Recursive handling of Maps and Lists
  • Preservation of data types and structure
  • Integration with json_serializable workflow

Primary Use Case: Converting parsed YAML configuration files into formats suitable for AssetXContext and related configuration classes that use json_serializable.

final yamlMap = loadYaml(yamlContent) as Map<dynamic, dynamic>; final jsonMap = YamlUtils.convertYamlToJson(yamlMap); final context = AssetXContext.fromJson(jsonMap);

Constructors

YamlUtils()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

convertYamlToJson(Map yamlMap) Map<String, dynamic>
Converts a YAML Map to a JSON-compatible Map structure.
parseYamlToJson(String yamlContent) Map<String, dynamic>
Parses YAML content from a string and converts to JSON-compatible format.