DiffView class

Scrollable unified or aligned split diff presentation.

Inheritance

Constructors

DiffView({required DiffDocument document, Key? key, DiffViewMode mode = DiffViewMode.unified, DiffViewController? controller, ScrollController? scrollController, CodeHighlighter highlighter = const PlainTextCodeHighlighter(), String? language, bool wrap = false, bool selectable = true, bool showLineNumbers = true, int splitColumnWidth = 40, FocusNode? focusNode, bool autofocus = false, bool canRequestFocus = true, Color? selectionForegroundColor, Color? selectionBackgroundColor, void onSelectionChanged(SelectedText? selection)?, SelectionCopyCallback? onCopy, HighlightErrorCallback? onHighlightError, DiffLineCallback? onLine, DiffHunkCallback? onHunk, DiffRowBuilder? rowBuilder})
Configures diff rendering, highlighting, navigation, and selection.
const

Properties

autofocus bool
Whether the diff requests focus after mounting.
final
canRequestFocus bool
Whether this diff participates in focus traversal.
final
controller DiffViewController?
Optional hunk navigation owner.
final
document DiffDocument
Parsed presentation model.
final
focusNode FocusNode?
Caller-owned focus node.
final
hashCode int
The hash code for this object.
no setterinherited
highlighter CodeHighlighter
Optional syntax range producer.
final
key Key?
Controls how this widget replaces another of the same type.
finalinherited
language String?
Language identifier passed to highlighter.
final
mode DiffViewMode
Unified or split presentation.
final
onCopy SelectionCopyCallback?
Receives explicit copy results.
final
onHighlightError HighlightErrorCallback?
Receives highlighting failures.
final
onHunk DiffHunkCallback?
Receives pointer activation of a hunk heading.
final
onLine DiffLineCallback?
Receives pointer activation of a diff line.
final
onSelectionChanged → void Function(SelectedText? selection)?
Receives the current non-empty selection.
final
rowBuilder DiffRowBuilder?
Optionally wraps or replaces each default hunk/line row.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
Optional owner for the diff's vertical scroll position.
final
selectable bool
Whether document text is selectable.
final
selectionBackgroundColor Color?
Selected text background override.
final
selectionForegroundColor Color?
Selected text foreground override.
final
showLineNumbers bool
Whether source coordinates are shown in row prefixes.
final
splitColumnWidth int
Content cells reserved for each side in split mode.
final
wrap bool
Whether long rows soft-wrap.
final

Methods

createState() State<DiffView>
Creates the mutable State for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited