I am using url_launcher package and trying to open a link like this:
try {
final Uri launchUri = Uri.dataFromString(
'<html><body>hello world</body></html>',
mimeType: 'text/html');
await launchUrl(launchUri);
} catch (e) {
print(e);
}
Only a blank screen with empty head and body tags open.
There is no error in the console.
How do I open an html file hard coded on flutter on a new window on flutter web?
should i create a blob?
2
Answers
One possibility is, save the generated html to the local file system. Then open that local file (with a file url) in the new window.
Try This Package : flutter_html
Example :