ConfigParser.fromJson constructor
Creates a ConfigParser instance from a JSON object.
This factory constructor is used to create a ConfigParser from an already parsed JSON representation of the configuration.
Parameters:
json- The JSON object containing the configuration dataglobalResults- Global command line argument results
Returns a new ConfigParser instance with the parsed configuration data
Implementation
factory ConfigParser.fromJson(
Map<String, dynamic> json, ArgResults? globalResults) {
return ConfigParser(
globalResults: globalResults,
tasks: json["tasks"],
environments: json["variables"] as Map<String, dynamic>,
arguments: (json["arguments"] as Map<String, dynamic>)
.map((key, value) => MapEntry(key, value as dynamic)),
);
}