|
|
|
@ -68,6 +68,7 @@ class EditableTextBlock extends StatelessWidget { |
|
|
|
|
required this.linkActionPicker, |
|
|
|
|
required this.cursorCont, |
|
|
|
|
required this.indentLevelCounts, |
|
|
|
|
required this.clearIndents, |
|
|
|
|
required this.onCheckboxTap, |
|
|
|
|
required this.readOnly, |
|
|
|
|
this.onLaunchUrl, |
|
|
|
@ -91,6 +92,7 @@ class EditableTextBlock extends StatelessWidget { |
|
|
|
|
final CustomStyleBuilder? customStyleBuilder; |
|
|
|
|
final CursorCont cursorCont; |
|
|
|
|
final Map<int, int> indentLevelCounts; |
|
|
|
|
final bool clearIndents; |
|
|
|
|
final Function(int, bool) onCheckboxTap; |
|
|
|
|
final bool readOnly; |
|
|
|
|
|
|
|
|
@ -107,7 +109,7 @@ class EditableTextBlock extends StatelessWidget { |
|
|
|
|
decoration: _getDecorationForBlock(block, defaultStyles) ?? |
|
|
|
|
const BoxDecoration(), |
|
|
|
|
contentPadding: contentPadding, |
|
|
|
|
children: _buildChildren(context, indentLevelCounts)); |
|
|
|
|
children: _buildChildren(context, indentLevelCounts, clearIndents)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BoxDecoration? _getDecorationForBlock( |
|
|
|
@ -122,11 +124,14 @@ class EditableTextBlock extends StatelessWidget { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Widget> _buildChildren( |
|
|
|
|
BuildContext context, Map<int, int> indentLevelCounts) { |
|
|
|
|
List<Widget> _buildChildren(BuildContext context, |
|
|
|
|
Map<int, int> indentLevelCounts, bool clearIndents) { |
|
|
|
|
final defaultStyles = QuillStyles.getStyles(context, false); |
|
|
|
|
final count = block.children.length; |
|
|
|
|
final children = <Widget>[]; |
|
|
|
|
if (clearIndents) { |
|
|
|
|
indentLevelCounts.clear(); |
|
|
|
|
} |
|
|
|
|
var index = 0; |
|
|
|
|
for (final line in Iterable.castFrom<dynamic, Line>(block.children)) { |
|
|
|
|
index++; |
|
|
|
|