flutter_smooth_markdown 0.3.2
flutter_smooth_markdown: ^0.3.2 copied to clipboard
High-performance Flutter markdown renderer with syntax highlighting, LaTeX math, tables, footnotes, SVG images, and real-time streaming support. Beautiful UI with customizable themes.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
0.3.2 - 2025-11-20 #
Added #
- β
Details & Summary Support - Collapsible content sections with interactive expand/collapse
- Support for HTML
<details>and<summary>tags - Automatic parsing of nested markdown content
- Click-to-expand/collapse functionality with animated arrow icons
- Default open state via
openattribute - Seamless integration with both standard and enhanced component modes
- Support for HTML
Implementation #
- Added
DetailsNodeto AST for representing collapsible sections - Implemented
DetailsBuilderwidget with stateful expand/collapse behavior - Parser logic for
<details>and<summary>HTML tags - Registered builder in both default and enhanced component registries
- Comprehensive test coverage (11 parser tests + 7 renderer tests)
Examples #
<details>
<summary>Click to expand</summary>
Hidden content that shows on click
</details>
<details open>
<summary>Expanded by default</summary>
This section starts expanded
</details>
0.3.1 - 2025-11-18 #
Fixed #
- π Table rendering crash - Fixed "irregular row lengths" error
- Tables with inconsistent column counts now render correctly
- Automatically fills missing cells with empty content
- Calculates correct column count from headers, alignments, and data rows
- Handles edge cases (empty tables, varying row lengths)
Technical Details #
- Improved table column count calculation logic in
TableBuilder - Replaced problematic
double.infinity.toInt()with safe max calculation - Added defensive checks to ensure at least 1 column in all tables
0.3.0 - 2025-11-18 #
π Major Performance Improvements #
- 32x Faster Rendering - LRU parse cache dramatically improves performance
- Smooth Scrolling - 60 FPS in chat/list scenarios with 50+ messages
- Memory Efficient - Smart caching with automatic eviction
Added #
- β
MarkdownParseCache - LRU cache for parsed AST nodes
- Cache hit: ~0.1ms vs ~3.6ms parsing (32x faster)
- Configurable size (default: 100 entries)
- Automatic LRU eviction
- Cache statistics API
- β
SmoothMarkdown enhancements:
enableCacheparameter (default: true) - Enable/disable parse cachinguseRepaintBoundaryparameter (default: true) - Isolate widget repaintsSmoothMarkdown.clearCache()- Clear global cacheSmoothMarkdown.cacheStatistics- Get cache usage stats
- β
StreamMarkdown optimizations:
- Throttling mechanism (50ms) - Batch rapid stream updates
- Automatic RepaintBoundary - Reduce overdraw
- Smart cache management - Disable cache for streaming content
- β
Performance Testing:
- Comprehensive cache performance tests (8 test cases)
- Benchmark results included in documentation
- Chat scenario simulation tests
- β
Chat List Demo - Production-ready chat interface example
- ChatGPT-like UI with message bubbles
- Real-time AI streaming responses
- Dark/light theme support
- Performance optimizations showcase
- Cache statistics viewer
Documentation #
- π Complete performance optimization guide (
doc/AIθ倩ε葨ζ§θ½δΌε.md) - π Performance benchmarks and comparisons
- π‘ Best practices for list/chat scenarios
- π― Optimization implementation summary (
doc/ζ§θ½δΌεζ»η».md)
Performance Impact #
- List Scrolling: 45 FPS β 60 FPS (+33%)
- Repeated Rendering: 3.6ms β 0.11ms (32x faster)
- Chat Scenario: 99.5% cache hit rate
- Memory Overhead: ~50KB per cached entry
Breaking Changes #
None - All optimizations are opt-in or enabled by default without breaking existing code.
0.2.0 - 2025-11-18 #
Major Improvements #
- π Complete API Documentation - Comprehensive dartdoc for all public APIs
- π― Developer Experience - Significantly improved IDE code completion
- π Production Ready - Professional-grade documentation quality
Added #
- Extensive documentation for SmoothMarkdown and StreamMarkdown widgets
- Complete MarkdownStyleSheet documentation with all factory methods
- Detailed MarkdownConfig documentation with security and performance notes
- Full MarkdownRenderer documentation including custom builder examples
- Multiple code examples and usage scenarios throughout the codebase
- Performance considerations and best practices in documentation
- Cross-references between related classes for better navigation
Improved #
- API documentation quality elevated to production standards
- Better IDE experience with detailed parameter descriptions
- Structured documentation with clear sections and examples
- Enhanced developer onboarding experience
0.1.9 - 2025-11-18 #
Added #
- Comprehensive dartdoc documentation for all public APIs
- Detailed documentation for core widgets (SmoothMarkdown, StreamMarkdown)
- Complete documentation for MarkdownStyleSheet with all factory methods
- Extensive documentation for MarkdownConfig with security and performance notes
- Full documentation for MarkdownRenderer including custom builder examples
- Multiple code examples and usage scenarios for each API
- Performance considerations and best practices throughout
Improved #
- API documentation quality significantly enhanced
- Better IDE code completion experience with detailed parameter descriptions
- Added "See also" cross-references between related classes
- Structured documentation with sections for features, usage, and examples
0.1.8 - 2025-11-18 #
0.1.6 - 2024-11-18 #
Changed #
- Enhanced package description with more keywords for better discoverability
- Added topics/tags to pubspec.yaml (markdown, renderer, syntax-highlighting, latex, streaming, widget, ui)
- Added pub.flutter-io.cn badges to README
- Added use cases section to README
- Added keywords section for SEO optimization
0.1.5 - 2024-11-18 #
Documentation #
- Updated installation instructions to reference version 0.1.4
- Ensured README shows latest version for new users
0.1.4 - 2024-11-18 #
Changed #
- Adjusted README screenshot display size to 600px width for better readability
0.1.3 - 2024-11-18 #
Added #
- Demo screenshots showcasing package features:
- Main interface (main.jpg)
- Code blocks with syntax highlighting (code.jpg)
- LaTeX math formula rendering (latx.jpg)
- Streaming markdown rendering (streaming.gif)
Documentation #
- Updated README with actual demo screenshots
- Improved visual presentation of package capabilities
0.1.2 - 2024-11-18 #
Documentation #
- Replaced example.com placeholder image links with real, working URLs
- Added Demo section showcasing package features
- Created screenshots directory structure for future demo images
- Updated image examples with Flutter logo and SVG icon
- Added streaming support to features list in README
0.1.1 - 2024-11-18 #
Documentation #
- Updated README to reflect Phase 4 (Stream support) completion status
- Clarified that streaming functionality is fully implemented with StreamMarkdown widget
- Added streaming demo reference in roadmap
0.1.0 - 2024-11-18 #
Added #
- Initial release of Flutter Smooth Markdown
- AST-based markdown parser with full CommonMark support
- Widget builder system for extensible rendering
- Built-in themes: Default (Light/Dark), GitHub (Light/Dark), VS Code (Light/Dark)
- Enhanced UI components:
- Code blocks with syntax highlighting and copy functionality
- Blockquotes with gradient backgrounds and quote icons
- Links with hover animations and external indicators
- Headers with decorative accents
- Basic markdown syntax support:
- Headers (H1-H6)
- Text formatting (bold, italic, strikethrough, inline code)
- Lists (ordered, unordered, task lists)
- Code blocks with syntax highlighting
- Links and images
- Blockquotes
- Horizontal rules
- Customizable style sheets with theme inheritance
- Example application demonstrating all features
- Comprehensive documentation in Chinese
Technical #
- Minimum SDK version: Dart >=3.0.0, Flutter >=3.0.0
- Dependencies:
- markdown: ^7.0.0
- flutter_highlight: ^0.7.0
- cached_network_image: ^3.3.0
- url_launcher: ^6.2.0
- flutter_math_fork: ^0.7.2
- flutter_svg: ^2.0.10+1
- 87+ unit tests with comprehensive coverage
- Flutter lints enabled for code quality