packageSubtreeBytesFromJson function
Decodes an analyze-size JSON file's text and sums the solution subtree.
Implementation
int? packageSubtreeBytesFromJson(String jsonText, String package) {
final dynamic doc;
try {
doc = jsonDecode(jsonText);
} on FormatException {
return null;
}
if (doc is! Map<String, dynamic>) return null;
return packageSubtreeBytes(doc, package);
}