allocJMap method

JMap allocJMap(
  1. String key
)

Unlike getJMap, this method creates a new JMap if the value does not exist.

Implementation

JMap allocJMap(String key) {
  final obj = _get<Map<String, dynamic>>(key);
  if (obj == null) {
    final newMap = <String, dynamic>{};
    map[key] = newMap;
    return JMap(newMap);
  } else {
    return JMap(obj);
  }
}