ui/widgets/diff_view library
Classes
- DiffColors
- Colors for diff rendering.
- DiffHunk
- A parsed diff hunk.
- DiffLine
- A single diff line.
- DiffView
- Widget that displays a unified diff.
- ScrollableDiffView
- Scrollable diff view for large diffs.
Enums
Functions
-
adjustHunkLineNumbers(
DiffHunk hunk, int offset) → DiffHunk - Adjust hunk line numbers by an offset (for partial file diffs).
-
countLinesChanged(
List< DiffHunk> hunks) → ({int additions, int removals}) - Count additions and removals in a diff.
-
generateDiff(
{required String oldContent, required String newContent, String oldPath = 'a/file', String newPath = 'b/file', int contextLines = 3}) → String - Generate a simple unified diff from old and new content.
-
parseUnifiedDiff(
String diffText) → List< DiffHunk> - Parse a unified diff string into hunks.