Fix _getContentTextLength in _Content

parent 865ae54d
......@@ -305,14 +305,13 @@ class _ContentLayoutRenderBox extends RenderBox
int _getContentTextLength(RenderParagraph renderParagraph) {
final span = renderParagraph.text as TextSpan;
if (span.children == null) {
return 0;
}
var length = span.text?.length ?? 0;
var length = 0;
for (final childSpan in span?.children) {
if (childSpan is TextSpan) {
length += childSpan.text?.length ?? 0;
if (span.children != null) {
for (final childSpan in span?.children) {
if (childSpan is TextSpan) {
length += childSpan.text?.length ?? 0;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment