mapFromJson static method

Map<String, PropertyItems> mapFromJson(
  1. Map<String, dynamic>? json
)

Implementation

static Map<String, PropertyItems> mapFromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return <String, PropertyItems>{};
  }

  return json.entries.fold(<String, PropertyItems>{},
      (Map<String, PropertyItems> previousValue, element) {
    final PropertyItems? object = PropertyItems.fromJson(element.value);
    if (object is PropertyItems) {
      previousValue[element.key] = object;
    }

    return previousValue;
  });
}