flutter_diff_viewer 1.0.0
flutter_diff_viewer: ^1.0.0 copied to clipboard
A production-grade Flutter package providing GitHub/GitLab-style content comparison and diff viewing. Supports side-by-side, unified, and stacked layouts with line, word, and character-level diff granularity.
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.
1.0.0 - 2026-08-17 #
Added #
- Initial release of
flutter_diff_viewer - GitHub/GitLab-style side-by-side diff view
- Unified diff view (single-column with +/- indicators)
- Stacked diff view (optimized for narrow/mobile screens)
- Line-level diff calculation using Myers LCS algorithm
- Word-level inline diff highlighting
- Character-level inline diff highlighting
- Staged diff processing (line → word → character, changed lines only)
FlutterDiffViewermain widget with simple and advanced APIFlutterDiffViewerControllerfor programmatic navigationFlutterDiffViewerConfiguration— fully immutable configuration objectFlutterDiffViewerThemewithlight()anddark()factory constructorsDiffTypography— full text style customizationDiffSpacing— layout spacing customizationDiffLocalizations— localization/i18n support- Custom builder callbacks:
headerBuilder,lineBuilder,lineNumberBuilder,indicatorBuilder,segmentBuilder,summaryBuilder,emptyStateBuilder,errorBuilder,loadingBuilder,collapsedSectionBuilder,footerBuilder DiffEngineabstract interface for pluggable diff algorithms- Replaceable diff engine via
FlutterDiffViewer(diffEngine: myEngine) - Synchronized scrolling for side-by-side view
- Collapsible unchanged sections with configurable
contextLines - Change navigation: next/previous/go-to change
- Line numbers, indicators (+/-/space), headers, summary widget
- Responsive layout via
LayoutBuilder - Accessibility: semantic labels, screen reader support, color-independent indicators
- Async diff processing with
compute()for large documents (>1000 lines) ListView.builderrendering — handles 50,000+ line documents efficiently- Proper lifecycle management — no controller or scroll leaks
- Full null safety (Dart 3.x)
- Comprehensive unit, widget, and integration tests
- Full API documentation
- Professional example application with 10+ screens