Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links not opening webview #43

Closed
l-k22 opened this issue Dec 12, 2018 · 1 comment
Closed

Links not opening webview #43

l-k22 opened this issue Dec 12, 2018 · 1 comment

Comments

@l-k22
Copy link

l-k22 commented Dec 12, 2018

I wasn't sure if this was the intention or a bug.
using version 0.8.2
example code

Html(
onLinkTap: (url){print('link tap: $url');},
  data: """
    <div>
      <h1>Demo Page</h1>
      <p>This is a fantastic <a href="https://www.google.com/">nonexistent product</a> that you should buy!</p>
      <h2>Pricing</h2>
      <p>Lorem ipsum <b>dolor</b> sit amet.</p>
      <h2>The Team</h2>
      <p>There isn't <i>really</i> a team...</p>
      <h2>Installation</h2>
      <p>You <u>cannot</u> install a <a href="https://www.google.com/">nonexistent product!</a></p>
    </div>
),

result: console prints url when link is tapped
expected result: device webbrowser to be opened sending user to link

My work around is to use another package 'url_launcher' to open the webbrowser

onLinkTap: (url){
print('link tap: $url');
_launch(url);
},

@Sub6Resources
Copy link
Owner

Yes, tapping a link only calls the callback and is not supposed to open a browser out of the box. The goal of this package is just to provide a very simple way to render html. Anything beyond that is up to the implementer, so using url_launcher is exactly what you need to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants