JsonHelper class

Helper class around product field conversion to/from JSON

Constructors

JsonHelper()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

attributeGroupsToJson(List<AttributeGroup>? list) List<Map<String, dynamic>>?
Returns a JSON map from AttributeGroups
checkboxFromJSON(dynamic jsonValue) bool?
checkboxToJSON(dynamic value) String?
dateToTimestamp(DateTime? dateTime) int?
Returns UTC seconds since epoch from a DateTime
imagesFromJson(Map? json) List<ProductImage>?
Returns ProductImages from a JSON map for "Images"
imagesToJson(List<ProductImage>? images) Map<String, dynamic>
ingredientsToJson(List<Ingredient>? ingredients) List<Map<String, dynamic>>?
Returns a JSON map from Ingredients
nullableStringTimestampToDate(dynamic json) DateTime?
Returns a DateTime from a JSON-encoded String (e.g. '2021-10-29T11:00:56.177379')
quantityFromJson(dynamic data) double?
Returns a double from a JSON-encoded int or double
selectedImagesFromJson(Map? json) List<ProductImage>?
Returns ProductImages from a product JSON map for "Selected images"
selectedImagesToJson(List<ProductImage>? images) Map<String, dynamic>
Returns a JSON map from ProductImages for "Selected images"
stringTimestampToDate(dynamic json) DateTime
Returns a DateTime from a JSON-encoded String (e.g. '2021-10-29T11:00:56.177379')
timestampToDate(dynamic json) DateTime?
Returns a DateTime from a JSON-encoded int (UTC seconds since epoch)