JsonObject.fromNodes constructor

JsonObject.fromNodes({
  1. required List<JsonNode> nodes,
  2. String key = "",
})

Construct a new JsonObject using the specified key values of each JsonNode.

Implementation

factory JsonObject.fromNodes({
  required List<JsonNode> nodes,
  String key = "",
}) =>
    JsonObject(
      data: {for (var node in nodes) node.key: node},
      key: key,
    );