LineDecoration class
Represents a decoration applied to a range of lines in the editor.
Line decorations can be used to highlight code changes (git diff), mark breakpoints, show coverage information, or any custom highlighting.
Example - Git diff added lines:
controller.addLineDecoration(LineDecoration(
startLine: 10,
endLine: 15,
type: LineDecorationType.background,
color: Colors.green.withOpacity(0.2),
));
Example - Git diff left border:
controller.addLineDecoration(LineDecoration(
startLine: 10,
endLine: 15,
type: LineDecorationType.leftBorder,
color: Colors.green,
thickness: 3,
));
Constructors
- LineDecoration({required String id, required int startLine, required int endLine, required LineDecorationType type, required Color color, double thickness = 3.0, int priority = 0})
-
Creates a line decoration.
const
Properties
- color → Color
-
The color of the decoration
final
- endLine → int
-
The end line (0-based, inclusive) of the decoration range
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Unique identifier for this decoration
final
- priority → int
-
Optional priority for overlapping decorations (higher = on top)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startLine → int
-
The start line (0-based) of the decoration range
final
- thickness → double
-
Thickness for border/underline decorations (default: 3.0)
final
- type → LineDecorationType
-
The type of decoration to apply
final
Methods
-
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.
override