fromTypedMap<T> static method
Construct a new JsonObject where each key is an enumerated value.
Implementation
static JsonObject fromTypedMap<T>(
{required Map<T, dynamic> data,
/// Convert enumerated key to String key.
required String Function(T) keyToString,
/// Node key.
String key = ""}) =>
JsonObject(
key: key,
data: data
.map((key, value) => MapEntry(keyToString.call(key), value))
.map(_buildJsonNodeMap));