BlockStyle class
Configuration for block visual styling.
This class allows customization of how blocks are rendered, including text styles, spacing, colors, and bullet appearance.
Example:
const customStyle = BlockStyle(
textStyle: TextStyle(fontSize: 18, color: Color(0xFF000000)),
indentWidth: 32.0,
bulletSize: 8.0,
);
Constructors
- BlockStyle({TextStyle textStyle = const TextStyle(fontSize: 16), TextStyle emptyTextStyle = const TextStyle(fontSize: 16, color: Color(0xFF9E9E9E)), TextStyle editingTextStyle = const TextStyle(fontSize: 16), double indentWidth = 24.0, double bulletSpacing = 8.0, double bulletSize = 6.0, Color? bulletColor, double collapseIconSize = 20.0, EdgeInsets contentPadding = const EdgeInsets.symmetric(vertical: 2), String emptyBlockText = 'Empty block'})
-
const
Properties
- bulletColor → Color?
-
Color of the bullet point
final
- bulletSize → double
-
Size of the bullet point (for blocks without children)
final
- bulletSpacing → double
-
Spacing between bullet and content
final
- collapseIconSize → double
-
Size of the collapse/expand icon (for blocks with children)
final
- contentPadding → EdgeInsets
-
Vertical padding for block content
final
- editingTextStyle → TextStyle
-
Text style for the TextField when editing
final
- emptyBlockText → String
-
Placeholder text for empty blocks
final
- emptyTextStyle → TextStyle
-
Text style for empty blocks (placeholder text)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indentWidth → double
-
Width of indentation per depth level
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textStyle → TextStyle
-
Text style for block content when not editing
final
Methods
-
copyWith(
{TextStyle? textStyle, TextStyle? emptyTextStyle, TextStyle? editingTextStyle, double? indentWidth, double? bulletSpacing, double? bulletSize, Color? bulletColor, double? collapseIconSize, EdgeInsets? contentPadding, String? emptyBlockText}) → BlockStyle - Creates a copy of this BlockStyle with the given fields replaced
-
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