GitDiffController class

Controller for GitDiffViewer.

Holds a GitDiffModel and delegates updates to it. Provides methods for setting diff content and configuring the display.

Constructors

GitDiffController({GitDiffModel? initial})
Creates a controller with an optional initial model.

Properties

commentAnchors List<DiffCommentAnchor>
Commentable anchors in the currently rendered diff.
no setter
commentHighlights List<DiffCommentLineHighlight>
Comment line highlights in the current model.
no setter
files List<DiffFile>
The parsed diff files.
no setter
hashCode int
The hash code for this object.
no setterinherited
model GitDiffModel
The current diff model state.
no setter
renderedLines List<String>
The full list of rendered diff lines (before viewport clipping).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollOffset int
Current vertical scroll offset.
no setter
scrollPercent double
Current scroll percentage.
no setter
totalAdditions int
Total additions across all files.
no setter
totalDeletions int
Total deletions across all files.
no setter
totalLineCount int
Total rendered line count.
no setter

Methods

addListener(void listener()) → void
Adds a listener for state changes.
commentAnchorAt(int renderLine, {DiffCommentSide? side}) DiffCommentAnchor?
Returns the comment anchor occupying renderLine.
commentAnchorIndexAt(int renderLine, {DiffCommentSide? side}) int?
Returns the index of the comment anchor occupying renderLine.
configure({bool? showLineNumbers, bool? wrapLines, bool? zeroPadLineNumbers, DiffViewMode? viewMode, DiffStyles? styles, List<DiffCommentLineHighlight>? commentHighlights}) → void
Configures display options.
nearestCommentAnchor(int renderLine) DiffCommentAnchor?
Returns the nearest comment anchor at or after renderLine.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(void listener()) → void
Removes a listener.
setDiff(String rawDiff) → void
Sets the raw unified diff text.
setScrollOffset(int offset) → void
Sets the viewport scroll offset.
setSize(int width, int height) → void
Updates the viewport size.
toString() String
A string representation of this object.
inherited
update(Msg msg) → (GitDiffModel, Cmd?)
Forwards a message to the underlying model.

Operators

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