flutter_smooth_markdown 0.5.2
flutter_smooth_markdown: ^0.5.2 copied to clipboard
High-performance Flutter markdown renderer with syntax highlighting, LaTeX math, tables, footnotes, SVG images, and real-time streaming support.
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.5.2 - 2025-12-04 #
Added #
- π
Mermaid Timeline Support - Timeline diagram rendering
TimelineChartDatamodel with sections, periods, and eventsTimelineParserfor parsing timeline syntaxTimelinePainterfor native Flutter rendering- Support for timeline titles and period labels
- Multiple events per period
- 5 new timeline examples in demo app
Fixed #
- π― Mermaid Diagram Centering - Fixed initial position not centered
- Auto-scale diagram to fit viewport while maintaining aspect ratio
- Proper centering calculation for InteractiveMermaidDiagram
- Diagram now displays centered on initial load
Improved #
- Better UX for interactive diagrams with smart initial zoom level
0.5.1 - 2025-11-26 #
Added #
- π― Mermaid Diagram Interactive Mode - Pan/zoom support for embedded Mermaid diagrams
- Adaptive height based on diagram content (no fixed 400px)
- Two-phase rendering: measure first, then apply InteractiveViewer
- Zoom range: 0.5x to 3.0x scale
- Infinite boundary margin for free pan/drag movement
Improved #
- π MermaidBuilder - Enhanced diagram rendering in markdown
_ScrollableMermaidDiagramnow auto-measures diagram height_EnhancedMermaidContainer._buildDiagramView()with same adaptive behavior- Better UX for Complex Example demo with all 4 Mermaid types
Fixed #
- Fixed lint warning for unnecessary double literal (5.0 β 5)
0.5.0 - 2025-11-26 #
Added #
-
π Mermaid Gantt Chart Support - Complete Gantt chart diagram rendering
GanttTaskmodel with id, name, start/end dates, status, and dependenciesGanttSectionfor organizing tasks into groupsGanttChartDatafor complete chart configuration- Task status support:
done,active,critical,milestone,normal - Task dependencies with
afterkeyword - Multiple date formats and duration formats (30d, 2w, 1M)
- Timeline header with automatic day/week/month view switching
- Today marker line
- Responsive layout support for mobile/tablet/desktop
-
π¨ Gantt Chart Painter - Native Flutter rendering
- Color-coded task bars by status
- Diamond markers for milestones
- Section-based alternating row backgrounds
- Grid lines and timeline headers
-
π± Mermaid Demo Updates - 4 new Gantt chart examples
- Basic Gantt chart
- Gantt chart with sections
- Task status demonstration
- Product release timeline
Changed #
- Updated topics in pubspec.yaml to include
mermaidandcharts - Added
DiagramType.ganttChartto diagram type enum - Integrated Gantt parser and painter into MermaidDiagram widget
Tests #
- 13 comprehensive Gantt chart tests covering parser, data model, and integration
0.4.1 - 2025-11-26 #
Fixed #
- π Fixed package description length to meet pub.flutter-io.cn requirements (60-180 characters)
0.4.0 - 2025-11-25 #
Added #
-
π Plugin System - Extensible parser plugins for custom markdown syntax
ParserPluginRegistryfor managing and registering pluginsBlockParserPluginandInlineParserPluginbase classes- Built-in plugins:
MentionPlugin,HashtagPlugin,EmojiPlugin,AdmonitionPlugin - Full documentation in
doc/ζδ»Άη³»η».md
-
π€ AI Chat Plugins - Specialized plugins for AI response parsing
ThinkingPlugin- Parse<thinking>blocks for AI reasoning processArtifactPlugin- Parse<artifact>blocks for code/document artifactsToolCallPlugin- Parse<tool_use>blocks for AI tool invocations- Custom widget builders:
ThinkingBuilder,ArtifactBuilder,ToolCallBuilder
-
π― AI Chat Demo - Production-ready AI chat interface
- Qwen3 Max model integration with thinking mode (
enable_thinking) - Real-time streaming response with SSE support
- Model selection dropdown (Qwen3 Max, Qwen Max, Qwen Plus, Qwen Turbo)
- Thinking mode toggle for Qwen3 models
- Quick prompt buttons for testing AI plugins
- Dark/light theme support
- Qwen3 Max model integration with thinking mode (
-
π Environment Variables - Secure API key management
.envfile support viaflutter_dotenv- API keys excluded from version control
Changed #
- Enhanced
SmoothMarkdownandStreamMarkdownwidgets to acceptpluginsparameter - Updated example app with AI Chat Demo entry
Documentation #
- Added plugin system documentation (
doc/ζδ»Άη³»η».md) - Updated README with plugin system and AI chat features
- Added code examples for custom plugin creation
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