headingNode function
Node
headingNode({
- required int level,
- String? text,
- Delta? delta,
- String? textDirection,
- Attributes? attributes,
Implementation
Node headingNode({
required int level,
String? text,
Delta? delta,
String? textDirection,
Attributes? attributes,
}) {
assert(level >= 1 && level <= 6);
return Node(
type: HeadingBlockKeys.type,
attributes: {
HeadingBlockKeys.delta: (delta ?? (Delta()..insert(text ?? ''))).toJson(),
HeadingBlockKeys.level: level.clamp(1, 6),
if (attributes != null) ...attributes,
if (textDirection != null) HeadingBlockKeys.textDirection: textDirection,
},
);
}