diff method

List<Diff> diff(
  1. String text1,
  2. String text2, [
  3. bool checklines = true,
  4. DateTime? deadline,
])

Find the differences between two texts. Simplifies the problem by stripping any common prefix or suffix off the texts before diffing.

  • text1 is the old string to be diffed.
  • text2 is the new string to be diffed.
  • checklines is an optional speedup flag. If false, then don't run a line-level diff first to identify the changed areas. Defaults to true, which does a faster, slightly less optimal diff.
  • deadline is an optional time when the diff should be complete by. Used internally for recursive calls. Users should set diffTimeout instead.

Returns a List of Diff objects.

Implementation

List<d.Diff> diff(String text1, String text2,
                  [bool checklines = true, DateTime? deadline]) {
  return d.diff(text1, text2, checklines: checklines, deadline: deadline,
      timeout: diffTimeout);
}