diff_view 0.3.0
diff_view: ^0.3.0 copied to clipboard
A fast side-by-side and unified diff view for Flutter, like JetBrains IDEs' diff viewer, with ribbons, synced scrolling, word highlights, folding, text selection and line selection.
0.3.0 #
- Text selection in the code: drag to select by character across lines, in one pane or across the unified rows as shown, with autoscroll past the edges. Double click selects a word, triple click a line, Shift-click extends the selection or selects from the last click, a click elsewhere or Escape clears. The pointer is a text cursor over code.
- Cmd/Ctrl+C copies the selected text as shown: lines joined by their own line ends, no markers or line numbers, folded lines left out. Lines a paging source hasn't loaded are loaded first.
DiffViewController.textSelection(aCodeSelectionController, aValueListenable<CodeSelection?>),clearTextSelectionandtextOf;CodeSelectionandCodePositiongive the side, start and end as line and column.selectionChangesfires for it.textSelectionEnabled(on by default) turns it off.- One selection at a time: a text selection clears the gutter selection and the other way round.
copySelectioncopies whichever there is, the unified one included. DiffThemeData.textSelection, set in both built-in themes; unset, the selection colour is used. The built-in colours are opaque, so a changed word's tint does not show inside a selection; a colour with transparency keeps it.LineLayout.offsetAthit tests a laid-out line.DiffPaneViewporttakestextSelection.- The example app shows the selection and has a Copy button.
0.2.0 #
UnifiedDiff: a single-column view driven by the sameDiffViewController, with old and new line numbers, deleted then inserted lines per change, folds, inlays, gutter selection with copy and syntax colours.UnifiedRowsmaps unified rows to old and new lines;RowSelectionandRowSelectionControllerhold the unified selection.jumpToLine,viewportYOfLineandensureLineVisibleact on the unified view when it is the one laid out. Switching views keeps the line in place.GutterMetrics.unifiedandDiffPaintResources.unifiedGutterlay out the two-number gutter;DiffPaneViewporttakesunified.DiffThemeData.unifiedDeletedLineandunifiedDeletedWordtint removed lines in the unified view; unset, they're the side-by-side colours.- The example app has a Split/Unified switch.
selectionChangesandgeometryChangesalso fire for the unified view.DiffPaneis aStatelessWidget.- Fix: an inlay added to a file shorter than the viewport no longer scrolls the view past its end and springs back.
0.1.0 #
- First release:
SideBySideDiff,DiffViewController,TextDiffand the pagingDiffLineSource.
