Operation class Null safety
Operation performed on a rich-text document.
Constructors
- Operation.delete(int length)
-
Creates operation which deletes
length
of characters.factory -
Operation.insert(dynamic data, [Map<
String, dynamic> ? attributes]) -
Creates operation which inserts
text
with optionalattributes
.factory -
Operation.retain(int? length, [Map<
String, dynamic> ? attributes]) -
Creates operation which retains
length
of characters and optionally applies attributes.factory
Properties
-
attributes
→ Map<
String, dynamic> ? -
Rich-text attributes set by this operation, can be
null
.read-only - data → Object?
-
Payload of "insert" operation, for other types is set to empty string.
final
- hashCode → int
-
The hash code for this object. [...]
read-only, override
- isDelete → bool
-
Returns
true
if this is a delete operation.read-only - isEmpty → bool
-
Returns
true
is this operation is empty. [...]read-only - isInsert → bool
-
Returns
true
if this is an insert operation.read-only - isNotEmpty → bool
-
Returns
true
is this operation is not empty.read-only - isNotPlain → bool
-
Returns
true
if this operation sets at least one attribute.read-only - isPlain → bool
-
Returns
true
if this operation has no attributes, e.g. is plain text.read-only - isRetain → bool
-
Returns
true
if this is a retain operation.read-only - key → String
-
Key of this operation, can be "insert", "delete" or "retain".
final
- length → int?
-
Length of this operation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- value → dynamic
-
Returns value of this operation. [...]
read-only
Methods
-
hasAttribute(
String name) → bool -
Returns
true
if this operation has attribute specified byname
. -
hasSameAttributes(
Operation other) → bool -
Returns
true
ifother
operation has the same attributes as this one. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toJson(
) → Map< String, dynamic> - Returns JSON-serializable representation of this operation.
-
toString(
) → String -
A string representation of this object. [...]
override
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
override