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({Object? data, Map<String, dynamic>? attributes})
Constructs a Line instance with optional initial data and attributes.

Properties

attributes Map<String, dynamic>?
Optional attributes associated with the line data.
getter/setter pair
clone Line
Creates a deep copy of the current Line instance.
no setter
data Object?
The main data object associated with the line.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

cleanLine() → void
Clears the data and attributes of the line, setting them to null.
mergeAttributes(Map<String, dynamic> attrs) → void
Merges additional attrs into the current attributes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAttributes(Map<String, dynamic>? attrs) → void
Sets the attributes of the line to attrs.
setData(Object? data) → void
Sets the data object of the line to data.
toString() String
A string representation of this object.

Operators

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