fromJson static method
Page
fromJson(
- dynamic value
)
Returns a new Page instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static Page fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return Page(
meta: PageMeta.fromJson(json[r'meta']),
channel: Channel.fromJson(json[r'channel']),
links: Links.mapFromJson(json[r'links']),
root: Pointer.fromJson(json[r'root']),
document: Pointer.fromJson(json[r'document']),
page: Elements.mapFromJson(json[r'page']),
);
}
throw ArgumentError('Value is not a map');
}