fromMap static method

ComponentByUuid? fromMap(
  1. Object? body
)

Implementation

static ComponentByUuid? fromMap(Object? body) {
  final componentName =
      body is Map && body.length == 1 ? '${body.keys.first}' : null;
  final source = readRecord(body, envelopeKey: componentName);
  if (source == null) return null;
  return ComponentByUuid(
    activityLogs: readList<ComponentByUuidActivityLog>(
        source['activity_logs'], ComponentByUuidActivityLog.fromMap),
    attributeGroups: readList<Object>(source['attribute_groups'], readAny),
    attributes: readList<ComponentByUuidAttribute>(
        source['attributes'], ComponentByUuidAttribute.fromMap),
    createdBy: readText(source['created_by']),
    createdOn: readText(source['created_on']),
    customForm: ComponentByUuidCustomForm.fromMap(source['custom_form']),
    customObjects: readList<Object>(source['custom_objects'], readAny),
    id: readText(source['id']),
    lastUpdatedBy: readText(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    parents: readList<ComponentByUuidParent>(
        source['parents'], ComponentByUuidParent.fromMap),
    restrictions: readList<Object>(source['restrictions'], readAny),
    status: readText(source['status']),
    uuid: readText(source['uuid']),
    version: readText(source['version']),
    componentName: componentName,
  );
}