toPatch method

  1. @useResult
Patch<String> toPatch()

Convert a UnifiedDiff back to a Patch between the source and target files.

Implementation

@useResult
Patch<String> toPatch() =>
    Patch(hunks.map((final hunk) => hunk.updates).reduce(
          (final before, final after) => [...before, ...after],
        ));