diff_match_patch 0.3.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 79

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 packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.3.0 Oct 9, 2018 Go to the documentation of diff_match_patch 0.3.0 Download diff_match_patch 0.3.0 archive
0.2.2 Oct 9, 2018 Go to the documentation of diff_match_patch 0.2.2 Download diff_match_patch 0.2.2 archive
0.2.1 Oct 1, 2014 Go to the documentation of diff_match_patch 0.2.1 Download diff_match_patch 0.2.1 archive
0.2.0 Jul 22, 2014 Go to the documentation of diff_match_patch 0.2.0 Download diff_match_patch 0.2.0 archive
0.1.0 Jul 3, 2014 Go to the documentation of diff_match_patch 0.1.0 Download diff_match_patch 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
80
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13

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. (-10.44 points)

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

line 154 col 11: Use isNotEmpty for Iterables and Maps.

line 216 col 7: Use isNotEmpty for Iterables and Maps.

line 222 col 7: Use isNotEmpty for Iterables and Maps.

line 252 col 72: Use = to separate a named parameter from its default value.

line 253 col 19: Use = to separate a named parameter from its default value.

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

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

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

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

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

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

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

Fix lib/src/diff/main.dart. (-3.45 points)

Analysis of lib/src/diff/main.dart reported 7 hints, including:

line 40 col 32: Use = to separate a named parameter from its default value.

line 40 col 54: Use = to separate a named parameter from its default value.

line 62 col 9: Use isNotEmpty for Iterables and Maps.

line 84 col 7: Use isNotEmpty for Iterables and Maps.

line 87 col 7: Use isNotEmpty for Iterables and Maps.

Fix additional 8 files with analysis or formatting issues. (-3.49 points)

Additional issues in the following files:

  • lib/src/match.dart (3 hints)
  • lib/src/diff/delta.dart (2 hints)
  • lib/src/diff/half_match.dart (1 hint)
  • lib/src/diff/utils.dart (1 hint)
  • lib/diff_match_patch.dart (Run dartfmt to format lib/diff_match_patch.dart.)
  • lib/src/api.dart (Run dartfmt to format lib/src/api.dart.)
  • lib/src/common.dart (Run dartfmt to format lib/src/common.dart.)
  • lib/src/diff/diff.dart (Run dartfmt to format lib/src/diff/diff.dart.)

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.

Dependencies

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