flutter_smooth_markdown 0.5.2 copy "flutter_smooth_markdown: ^0.5.2" to clipboard
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
    • TimelineChartData model with sections, periods, and events
    • TimelineParser for parsing timeline syntax
    • TimelinePainter for 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
    • _ScrollableMermaidDiagram now 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

    • GanttTask model with id, name, start/end dates, status, and dependencies
    • GanttSection for organizing tasks into groups
    • GanttChartData for complete chart configuration
    • Task status support: done, active, critical, milestone, normal
    • Task dependencies with after keyword
    • 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 mermaid and charts
  • Added DiagramType.ganttChart to 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

    • ParserPluginRegistry for managing and registering plugins
    • BlockParserPlugin and InlineParserPlugin base 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 process
    • ArtifactPlugin - Parse <artifact> blocks for code/document artifacts
    • ToolCallPlugin - 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
  • πŸ” Environment Variables - Secure API key management

    • .env file support via flutter_dotenv
    • API keys excluded from version control

Changed #

  • Enhanced SmoothMarkdown and StreamMarkdown widgets to accept plugins parameter
  • 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 open attribute
    • Seamless integration with both standard and enhanced component modes

Implementation #

  • Added DetailsNode to AST for representing collapsible sections
  • Implemented DetailsBuilder widget 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:
    • enableCache parameter (default: true) - Enable/disable parse caching
    • useRepaintBoundary parameter (default: true) - Isolate widget repaints
    • SmoothMarkdown.clearCache() - Clear global cache
    • SmoothMarkdown.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 #

Removed #

  • Removed unused markdown: ^7.0.0 dependency (package uses custom parser implementation)

Changed #

  • Reduced package size by removing unnecessary dependencies

0.1.7 - 2025-11-18 #

Changed #

  • Package maintenance release
  • Ensure all documentation is synchronized

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
4
likes
150
points
405
downloads

Publisher

unverified uploader

Weekly Downloads

High-performance Flutter markdown renderer with syntax highlighting, LaTeX math, tables, footnotes, SVG images, and real-time streaming support.

Repository (GitHub)
View/report issues
Contributing

Topics

#markdown #renderer #syntax-highlighting #mermaid #chart

Documentation

API reference

License

MIT (license)

Dependencies

cached_network_image, flutter, flutter_highlight, flutter_math_fork, flutter_svg, url_launcher

More

Packages that depend on flutter_smooth_markdown