I have a simple web app I have created with flutter web. I would like to know how I can open new an external url
either in a new tab
or in the sa
One simple way is to just create a button and use dart:html
's window.open() method:
import 'dart:html' as html;
// ...
html.window.open('https://stackoverflow.com/questions/ask', 'new tab');
The name
parameter — which I left as 'new tab'
— refers to the new tab's window name, about which you can learn more from MDN's documentation.