StoreAttribute.fromJson constructor

StoreAttribute.fromJson(
  1. Map<String, Object?> json
)

Reads the Store API's representation.

Implementation

factory StoreAttribute.fromJson(Map<String, Object?> json) => StoreAttribute(
  id: readInt(json['id'], orElse: 0),
  name: readString(json['name']),
  taxonomy: readString(json['taxonomy']),
  hasVariations: readBool(json['has_variations']),
  terms: <StoreTerm>[
    for (final Map<String, Object?> t in readObjects(json['terms']))
      StoreTerm.fromJson(t),
  ],
);