Skip to content

Conversation

@ProjectAJ14
Copy link
Contributor

Description

Adds support for clickable <a> tags with href attributes to the HtmlRichText widget, enabling interactive links with customizable styling and tap callbacks.

Changes

  • Convert widget from StatelessWidget to StatefulWidget for proper gesture recognizer lifecycle management
  • Add onLinkTap callback parameter that receives the URL when a link is tapped
  • Parse <a href="..."> tags and extract href attributes for clickable functionality
  • Apply default blue underlined styling to links (customizable via tagStyles['a'])
  • Properly dispose TapGestureRecognizers to prevent memory leaks
  • Add comprehensive test coverage for all link scenarios (18+ new tests)
  • Update example app with interactive link demonstrations
  • Update README with detailed documentation and usage examples

Screenshots/videos

(Interactive examples available in the updated example app)

Related Issues

Implements user-requested clickable link functionality for the html_rich_text package.

Additional Notes

  • Links without href attributes are styled but not clickable
  • Links without onLinkTap callback are styled but not clickable
  • Maintains backward compatibility - no breaking changes to existing API
  • Zero external dependencies added, keeping the package lightweight

…callback

- Convert widget from StatelessWidget to StatefulWidget for gesture recognizer lifecycle
- Add onLinkTap callback parameter for handling link clicks
- Parse <a> tags with optional href attributes
- Apply default blue underlined styling to links (customizable via tagStyles)
- Properly dispose TapGestureRecognizers to prevent memory leaks
- Add comprehensive tests for link functionality
- Update example to demonstrate various link usage patterns
…tion

- Add clickable links examples and usage patterns
- Document onLinkTap callback parameter
- Update supported features section
- Add link-specific use cases
- Update limitations to reflect link support
 - html_rich_text@1.1.0
@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ackages/html_rich_text/lib/src/html_rich_text.dart 92.30% 4 Missing ⚠️
Flag Coverage Δ
html_rich_text 93.15% <92.30%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ackages/html_rich_text/lib/src/html_rich_text.dart 93.15% <92.30%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ProjectAJ14 ProjectAJ14 merged commit ce42476 into main Aug 13, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants