[Solved] What's the difference between dart:html vs package:html in dart?

Question

Asked by Jaden L on January 13, 2022 (source).

I'm attempting to create an epub document creator in flutter, and thus need to have something that programmatically builds xhtml files. I'm not sure which library to start with, here, nor what their different purposes are.

Answer

Question answered by jamesdlin (source).

From the dart:html documentation:

HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model).

From the package:html package description:

APIs for parsing and manipulating HTML content outside the browser.

In other words, dart:html is used for Dart for the web to interact with a web browser. package:html is an HTML parser without a web browser.

ANDROID DART FLUTTER
SHARE: