compareTo method
Describe the difference between this span and another, in terms of how much damage it will make to the rendering. The comparison is deep.
Comparing InlineSpan objects of different types, for example, comparing a TextSpan to a WidgetSpan, always results in RenderComparison.layout.
See also:
- TextStyle.compareTo, which does the same thing for TextStyles.
Implementation
@override
RenderComparison compareTo(InlineSpan other) {
RenderComparison comparison = super.compareTo(other);
if (comparison == RenderComparison.identical) {
if (widgetSpanSize.size !=
(other as ExtendedWidgetSpan).widgetSpanSize.size) {
return RenderComparison.layout;
}
}
if (comparison == RenderComparison.identical) {
comparison = baseCompareTo(other as SpecialInlineSpanBase);
}
return comparison;
}