Hello World Hello World Hello World

Open HTML content on another tab in flutter

37 Views Asked by At

I am trying to open html content on other tab.
I am using this below code to open :

// this is dummy html
String myHtml ="<html><body>Hello World</body></html>";
launchUrl(Uri.dataFromString(myHtml, mimeType: 'text/html', encoding: utf8),
                          mode: LaunchMode.externalApplication,
                          webViewConfiguration: WebViewConfiguration(
                              enableJavaScript: false,
                              enableDomStorage: false,
                              headers: {
                                "Content-Type": "text/html",
                                "Cache-Control": "no-cache",
                                'Authorization': '',
                                'Refresh': '5',
                              }
                          ));

After run this code new tab opens and shows blank, then I refresh the page then page starts showing.
I have to manually refresh the page every time, then page is showing.

0

There are 0 best solutions below