jsonObject<T> function
Builds a map from a JSON object.
Reads a JSON object and builds a value for each object value
using valueBuilder
. Then creates a Map<String, T>
of
the keys and built values.
Implementation
JsonBuilder<Map<String?, T>> jsonObject<T>(JsonBuilder<T> valueBuilder) =>
(JsonReader reader) {
reader.expectObject();
var result = <String?, T>{};
String? key;
while ((key = reader.nextKey()) != null) {
result[key] = valueBuilder(reader);
}
return result;
};