TextBlockItem class
A block of text within the Portable Text document. This is the most common and popular block item within the Portable Text instance. Most of the fields are based on the specification for Portable Text, which can be seen here: https://www.portabletext.org/
- Implemented types
- Annotations
-
- @JsonSerializable()
Constructors
-
TextBlockItem({String? key, List<
Span> children = const <Span>[], String style = 'normal', List<MarkDef> markDefs = const <MarkDef>[], ListItemType? listItem, int? level, int? listItemIndex}) -
TextBlockItem.fromJson(Map<
String, dynamic> json) -
factory
Properties
- blockType → String
-
A unique string-name for the block type.
no setteroverride
-
children
→ List<
Span> -
Children is an array of spans or custom inline types that is contained within a block.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
final
- level → int?
-
This specifies the visual nesting level of the block.
Nested blocks are indented on the left.
final
- listItem → ListItemType?
-
A block can be given the property listItem with a value that describes
which kind of list it is. Typically bullet, number, square and so on.
The list position is derived from the position the block has in the array
and surrounding list items on the same level.
final
- listItemIndex ↔ int?
-
To explicitly track the index of the list item.
This is a derived field and usually set by a higher level component.
getter/setter pair
-
markDefs
→ List<
MarkDef> -
Mark definitions is an array of objects with a key, type and some data.
Mark definitions are tied to spans by adding the referring _key in the marks array.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → String
-
Style typically describes a visual property for the whole block. Typical values
are "h1", "h2", "h3", "normal", "blockquote", etc.
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.
inherited
Constants
- schemaName → const String