Line class

Represents a line of data with associated attributes.

This class encapsulates a data object and optional attributes associated with that data. It provides methods to manipulate and manage the data and attributes.

Example usage:

// Creating a new Line instance
Line line = Line(data: 'Example data', attributes: {'color': 'red'});

// Setting new data and merging attributes
line.setData('Updated data');
line.mergeAttributes({'size': '12px'});

print(line.toString()); // Output: Data: Updated data, attributes: {color: red, size: 12px}

Constructors

Line.new({required List<TextFragment> fragments})
Line.fromData({required Object data, Map<String, dynamic>? attributes})
Line.newLine()

Properties

clone Line
Creates a deep copy of the current Line instance.
no setter
first TextFragment?
no setter
fragments List<TextFragment>
no setter
hashCode int
The hash code for this object.
no setteroverride
id String
final
isEmbedFragment bool
no setter
isEmpty bool
no setter
isNewLine bool
no setter
isNotEmpty bool
no setter
isSealed bool
no setter
isSingle bool
no setter
isTextInsert bool
no setter
last TextFragment?
no setter
length int
no setter
rawFragments List<TextFragment>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textLength int
no setter
toPlainText String
no setter

Methods

addFragment(TextFragment fragment) → void
elementAt(int index) TextFragment
elementAtOrNull(int index) TextFragment?
insertAt(int index, TextFragment fragment) → void
insertBefore(int index, TextFragment fragment) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFragment(TextFragment fragment) → void
removeFragmentAt(int index) → void
removeFragmentWhere({required bool where(TextFragment)}) → void
seal() → void
toPrettyString({String indent = ' '}) String
toString() String
A string representation of this object.
override
unseal() → void
updateFragment(int index, TextFragment fragment) → void

Operators

operator ==(covariant Line other) bool
The equality operator.
override
operator [](int index) TextFragment
operator []=(int index, TextFragment fragment) → void