computeWidgetSpanWidth static method
Implementation
static double? computeWidgetSpanWidth(InlineSpan? span, {double? width}) {
if (width == null) {
width = 0;
}
if (span == null) {
return width;
}
if (span is TextSpan) {
width = width + (span.text?.runes?.length ?? 0);
if (span.children != null) {
for (InlineSpan child in span.children!) {
width = width! + computeWidgetSpanWidth(child, width: width)!;
}
}
}
// else if (span is VdWidgetSpan) {
// width = width + span.width ?? 1;
// return width;
// }
else if (span is WidgetSpan) {
width = width + 1;
}
return width;
}