PageData class

class represent the data from web request returns.

Constructors

PageData(String url, String html, {String? jsonData, String? defaultJsonId})
parse the html into object's document. object's jsonData first come from the parameter's jsonData and decode it into json object. if defaultJsonId is not null then get data from document that has id named defaultJsonId, otherwise set to null
PageData.auto(String url, dynamic content)
factory
PageData.html(String url, String html)
PageData.json(String url, dynamic jsonData)

Properties

document ↔ Document?
the document that parse the html using html package.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
html String
the html page.
final
jsonData ↔ dynamic
the jsonData than in the html page that has the id defaultJsonId or the web request returns application/json data. or user parse that html page and get some jsondata.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url String
the url that web data comes from
final

Methods

getJsonDataById(String? id) → dynamic
get jsonData from document that has id named id if not throw Exception.
getRootElement() PageNode
get the pageNode that represent the document's documentElement and jsonData.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
root() PageNode
equal to getRootElement.
toString() String
A string representation of this object.
inherited

Operators

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