Add custom hyperlink callback for rich text hyperlinks #3335
Labels
enhancement
New feature or request
good first issue
Good for newcomers
Hacktoberfest
Issues that count towards Hacktoberfest scores.
Milestone
Checklist
Is your feature request related to a problem?
I am working on a graphical browser for the Gemini protocol, and I am using the rich text widget to display page content. When I click a hyperlink in the rich text, I want to load the page within my application. However current behavior opens URL in the web browser by default with no way to customize the behavior for rich text hyperlinks AFAIK.
Is it possible to construct a solution with the existing API?
No response
Describe the solution you'd like to see.
I think it would be useful to have custom callbacks within rich text hyperlinks. Currently, while the Hyperlink widget supports a custom callback (#2979), this is not supported for HyperlinkSegments in the RichText widget.
One solution would be to add an
OnTapped
field to HyperlinkSegment (following the design for Hyperlink) and pass it to the Hyperlink that gets generated inHyperlinkSegment.Visual()
:Example usage:
The text was updated successfully, but these errors were encountered: