Skip to content
pubscout

diff_match_patch

0.4.1, released 5 years ago by an unverified publisher

Dart library implementing diff, match and patch algorithms for plain text.

WASM-ready
$ flutter pub add diff_match_patch
Source repository

What it does

Provides Myer's diff algorithm, a Bitap matching algorithm, and patch utilities to compare and synchronize plain text. It includes pre‑diff speedups and post‑diff cleanups for better performance and output quality.

AI-written summary of version 0.4.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to compute differences between two strings
  • You need to generate or apply text patches in a Dart or Flutter app

Skip it when

  • You require real‑time collaborative editing with conflict resolution
  • You need a full‑featured diff/merge UI component

Strengths

  • Robust, well‑tested algorithms
  • Null‑safety support
  • No external dependencies

Weaknesses

  • Only works with plain text, not structured data
  • No built‑in UI components for displaying diffs

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Alternatives

Packages that do the same job and could replace diff_match_patch.

  • json_patch

    Pure Dart utility package for the JSON Patch standard to apply patches and perform diffs.

Works with

Packages commonly used together with diff_match_patch: ones it builds on, ones built on it, and its own family.