fromJson static method
Image?
fromJson(
- dynamic value
)
Returns a new Image instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static Image? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return Image(
width: mapValueOfType<int>(json, r'width'),
height: mapValueOfType<int>(json, r'height'),
lastModified: mapValueOfType<int>(json, r'lastModified'),
mimeType: mapValueOfType<String>(json, r'mimeType'),
size: mapValueOfType<int>(json, r'size'),
links: Links.mapFromJson(json[r'links']),
);
}
return null;
}