Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 2.48 KB

File metadata and controls

87 lines (67 loc) · 2.48 KB

Showing URLs on Flutter web with TextSpan

Did you know?

You can show native-looking URL links on Flutter web using TextSpan:

  • Create a Text.rich or SelectableText.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, you can 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:


Previous Next
A/B Testing in Flutter TextFormField Setup for Numeric Inputs