Using flutter_widget_from_html, my html is rendering, but the links are not launching. I am using th url_launcher package and my code is below.
Am i doing something wrong?
HtmlWidget('<p>This is a <a href="https://bbc.co.uk">link</a></p>',
onTapUrl: (url) => canLaunchUrl(Uri.parse(url)),
renderMode: RenderMode.column,
textStyle: TextStyle(fontSize: 20),
)
canLaunchUrl
is a function to check if the specified URL can be launched, and returns a boolean. To actually launch the URL, use launchUrl
.
onTapUrl: (url) => launchUrl(Uri.parse(url)),