diff_match_patch 0.3.0

  • Readme
  • Changelog
  • Installing
  • 73

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]
79
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
57
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Jan 20, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

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

Analysis of lib/src/patch.dart reported 62 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 68 col 18: Unnecessary new keyword.

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

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

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

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 44 col 16: Unnecessary new keyword.

line 47 col 31: Unnecessary new keyword.

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

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

line 24 col 32: Unnecessary new keyword.

line 25 col 27: Unnecessary new keyword.

line 26 col 26: Unnecessary new keyword.

line 27 col 29: Unnecessary new keyword.

line 28 col 31: Unnecessary new keyword.

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

Additional issues in the following files:

  • lib/src/diff/utils.dart (18 hints)
  • lib/src/api.dart (15 hints)
  • lib/src/diff/delta.dart (14 hints)
  • lib/src/match.dart (11 hints)
  • lib/src/diff/diff.dart (7 hints)
  • lib/src/diff/half_match.dart (2 hints)
  • lib/diff_match_patch.dart (1 hint)
  • lib/src/common.dart (1 hint)
  • lib/src/diff.dart (1 hint)

Maintenance suggestions

Package is getting outdated. (-27.95 points)

The package was last published 66 weeks ago.

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