Search code examples
flutterflutter-web

How to open a page in new tab in flutter web?


I want to open a page in a new tab, but could not find any code. Any help or idea, please? I am not asking about opening a URL on a new page... I just want to open the page in a new tab on button click.


Solution

  • import 'package:universal_html/html.dart' as html;
    
     static openNewTab({String setUrl, String setTitle}) {
        return html.window.open(
          setUrl,
          setTitle,
        );
      }