PatchPainter class final
Paints the rows from syntax's layoutDiff as noir text, one terminal
line per row.
Every line is cut or padded to exactly the given width, so line
backgrounds fill the row. A cut line ends in …, colored like a changed
word when it hides one. In split mode each side gets half. Colors are
opaque, painted over the theme's background, and control characters
are shown as `` so diff text can't send escape sequences to the
terminal.
Constructors
-
PatchPainter({required List<
FileDiff> files, required DiffHighlightCache highlights, DiffLabels labels = const syntax.DiffLabels(), bool showBackgrounds = true, bool showChangeIndicators = true, DiffIndicators indicators = syntax.DiffIndicators.classic, bool showLineNumbers = true, HunkSeparatorStyle hunkSeparatorStyle = syntax.HunkSeparatorStyle.lineInfo}) -
A painter for
files, highlighted byhighlights, which a view can keep across painters so files are only highlighted once.
Properties
-
files
→ List<
FileDiff> -
The files the rows refer to by index.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlights → DiffHighlightCache
-
Highlighting and changed words per file.
final
- hunkSeparatorStyle → HunkSeparatorStyle
-
Presentation of gaps and section metadata.
final
- indicators → DiffIndicators
-
Marker style independent of line backgrounds.
final
- labels → DiffLabels
-
The words shown in headers, notices and collapsed lines.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showBackgrounds → bool
-
Whether changed lines receive a tinted background.
final
- showChangeIndicators → bool
-
Whether gutters display addition and deletion markers.
final
- showLineNumbers → bool
-
Shows source line numbers in gutters.
final
- theme → SyntaxTheme
-
The theme, from highlights.
no setter
Methods
-
empty(
{required int width}) → TextSpan - The line shown when there are no files at all.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
DiffRow row, {required int width, bool selected = false, int codeOffset = 0, bool ellipsis = true}) → TextSpan -
rowas one line ofwidthcells. Aselectedrow gets a marker in its first cell. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited