Decoder class

The Decoder class is responsible for orchestrating the entire scraping process for an NFE.

It performs the following tasks in sequence:

  1. Constructs the actual URL to be scraped using the URLBuilder.
  2. Fetches the HTML content of the constructed URL using the HTTPClient.
  3. Determines the state from the provided URL using the URLStateExtractor.
  4. Delegates the scraping process to the appropriate scraper via ScraperFactory.
  5. Returns the scraped NFE object.

Example usage:

var decoder = Decoder('some_nfe_url');
var nfe = await decoder.scrapeNfe();
print(nfe);

Note: The URLs provided in the example at the bottom are typical NFE URLs from the RS state.

Constructors

Decoder(String url)
Creates a Decoder instance with the given url.

Properties

hashCode int
The hash code for this object.
no setterinherited
httpClient HTTPClient
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scraper BaseScraper?
getter/setter pair
urlBuilder URLBuilder
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scrapeNfe() Future<NFE>
Initiates the NFE scraping process.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

isNfeUrl(String url) bool