Did you know?
You can show native-looking URL links on Flutter web using TextSpan
:
- Create a
Text.rich
orSelectableText.rich
widget - Make it look like a web link with a custom text style
- Add a gesture recognizer to open the web link
- Customize the mouse cursor style
As an alternative, wrap the whole thing with a Link
widget (from the url_launcher
package):
Here's a complete URLTextWidget
that implements the whole thing, in 40 lines of code:
Happy coding!