Overview
ExpandableRichText is a Flutter widget that displays text with a limited initial height, allowing users to expand and view the full content. It supports rich text formatting and includes built-in handling for clickable @mentions, making it ideal for chat interfaces or long-form content previews. The widget is designed for smooth user interaction across multiple platforms, including mobile, web, and desktop. It integrates seamlessly into cards or expansion tiles where space efficiency and interactivity are key.
Use cases
- Chat message previews
- Long-form content summaries
- User comment sections
- Interactive rich text displays
- Dynamic text expansion in lists
- Social media-style post views
Key features
- Limited initial line display
- Auto-expansion on tap
- Clickable @mentions
- Rich text support
- Cross-platform compatibility
- Customizable expand/collapse behavior
Suitable for
- Developers building chat apps
- UI designers needing compact text components
- Apps with dynamic content length
- Projects requiring interactive text elements
- Teams using rich text with mentions
- Multi-platform Flutter applications
Considerations
- May require additional styling for complex layouts
- Performance impact with very long texts
- Needs careful handling of nested widgets
- Limited to text-based interactions
- Not suitable for non-interactive content
- Requires proper context for mention parsing