diff_match_patch 0.3.0

  • Readme
  • Changelog
  • Installing
  • 76

Diff Match Patch #

This is a port of google-diff-match-patch library to Dart. Initially maintained by localvoid, handed off to jheyne for upgrades.

Algorithms #

This library implements Myer's diff algorithm which is generally considered to be the best general-purpose diff. A layer of pre-diff speedups and post-diff cleanups surround the diff algorithm, improving both performance and output quality.

This library also implements a Bitap matching algorithm at the heart of a flexible matching and patching strategy.

v0.3.0 (2018-10-10) #

  • Support for Dart 2.0

v0.2.2 (2018-10-09) #

  • Fix implementation of Diff == (and added hashcode)
  • Upgrade from unittest to test package

v0.2.1 (2014-10-01) #

  • Update docs to use proper markdown for dartdocs.org

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  diff_match_patch: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:diff_match_patch/diff_match_patch.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
83
Health:
Code health derived from static analysis. [more]
58
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
84
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:diff_match_patch/diff_match_patch.dart.

Health suggestions

Fix lib/src/patch.dart. (-15.67 points)

Analysis of lib/src/patch.dart reported 34 hints, including:

line 1 col 1: Prefer using /// for doc comments.

line 27 col 1: Prefer using /// for doc comments.

line 37 col 3: Prefer using /// for doc comments.

line 44 col 3: Prefer using /// for doc comments.

line 90 col 1: Prefer using /// for doc comments.

Fix lib/src/api.dart. (-7.24 points)

Analysis of lib/src/api.dart reported 15 hints, including:

line 1 col 1: Prefer using /// for doc comments.

line 25 col 1: Prefer using /// for doc comments.

line 34 col 3: Prefer using /// for doc comments.

line 39 col 3: Prefer using /// for doc comments.

line 44 col 3: Prefer using /// for doc comments.

Fix lib/src/diff/cleanup.dart. (-5.84 points)

Analysis of lib/src/diff/cleanup.dart reported 12 hints, including:

line 30 col 1: Prefer using /// for doc comments.

line 40 col 10: Don't explicitly initialize variables to null.

line 76 col 13: Use isNotEmpty for Iterables and Maps.

line 143 col 1: Prefer using /// for doc comments.

line 228 col 14: Use isNotEmpty for Iterables and Maps.

Fix additional 9 files with analysis or formatting issues. (-23.57 points)

Additional issues in the following files:

  • lib/src/diff/main.dart (12 hints)
  • lib/src/diff/utils.dart (11 hints)
  • lib/src/match.dart (8 hints)
  • lib/src/diff/diff.dart (7 hints)
  • lib/src/diff/delta.dart (4 hints)
  • lib/src/common.dart (2 hints)
  • lib/src/diff/half_match.dart (2 hints)
  • lib/diff_match_patch.dart (1 hint)
  • lib/src/diff.dart (1 hint)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and diff_match_patch.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Package is getting outdated. (-0.55 points)

The package was last published 52 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test any