toExternal method

void toExternal(
  1. String newUrl, {
  2. bool openNewTab = false,
})

Goes to an url which is not in the app

On the web, you can set openNewTab to true to open this url in a new tab

Also see:

  • to if you don't need segment encoding
  • toSegments if you need your path segments to be encoded
  • toNamed if you want to navigate by name

Implementation

void toExternal(String newUrl, {bool openNewTab = false}) => _updateUrl(
      Uri.parse(newUrl),
      newVRoute: null, // Since it's external, we have no new VRoute
      onCancel: () {
        VLogPrinter.show(
          VStoppedNavigationTo(
            vNavigationMethod: VNavigationMethod.toExternal,
            url: newUrl,
          ),
        );
      },
      onUpdate: () {
        VLogPrinter.show(
          VSuccessfulNavigationTo(
            vNavigationMethod: VNavigationMethod.toExternal,
            url: newUrl,
          ),
        );

        BrowserHelpers.pushExternal(newUrl, openNewTab: openNewTab);
      },
    );