DiffTypography class
An immutable set of TextStyles used throughout the diff viewer.
Provides distinct typographic treatments for code content, line numbers, headers, diff indicators, and state labels.
Use DiffTypography.defaults as a starting point, then override individual styles with copyWith.
final typography = DiffTypography.defaults().copyWith(
codeStyle: TextStyle(fontFamily: 'JetBrains Mono', fontSize: 14),
);
Constructors
- DiffTypography({required TextStyle codeStyle, required TextStyle lineNumberStyle, required TextStyle headerStyle, required TextStyle summaryStyle, required TextStyle addedStyle, required TextStyle removedStyle, required TextStyle modifiedStyle, required TextStyle unchangedStyle, required TextStyle indicatorStyle, required TextStyle collapsedStyle})
-
Creates an immutable DiffTypography.
const
- DiffTypography.defaults()
-
Returns the default typography suitable for code diffs at 13 sp.
factory
Properties
- addedStyle → TextStyle
-
Style applied to text spans on added lines.
final
- codeStyle → TextStyle
-
Primary style for all monospaced diff content (line text).
final
- collapsedStyle → TextStyle
-
Style for the label inside a collapsed-section placeholder row.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- headerStyle → TextStyle
-
Style for the header bar labels (old/new version labels).
final
- indicatorStyle → TextStyle
-
Style for the
+,-, and space change-indicator characters.final - lineNumberStyle → TextStyle
-
Style for the line-number gutter text.
final
- modifiedStyle → TextStyle
-
Style applied to text spans on modified lines.
final
- removedStyle → TextStyle
-
Style applied to text spans on removed lines.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- summaryStyle → TextStyle
-
Style for the summary statistics bar (additions/deletions count).
final
- unchangedStyle → TextStyle
-
Style applied to text spans on unchanged lines.
final
Methods
-
copyWith(
{TextStyle? codeStyle, TextStyle? lineNumberStyle, TextStyle? headerStyle, TextStyle? summaryStyle, TextStyle? addedStyle, TextStyle? removedStyle, TextStyle? modifiedStyle, TextStyle? unchangedStyle, TextStyle? indicatorStyle, TextStyle? collapsedStyle}) → DiffTypography - Returns a copy of this typography with the given styles replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override