compareTo method
Implementation
RenderComparison compareTo(LyricStyle other) {
if (identical(this, other)) {
return RenderComparison.identical;
}
if (lineGap != other.lineGap ||
contentPadding != other.contentPadding ||
translationLineGap != other.translationLineGap) {
return RenderComparison.layout;
}
final styles = [textStyle, translationStyle, activeStyle];
final otherStyles = [
other.textStyle,
other.translationStyle,
other.activeStyle
];
for (var i = 0; i < styles.length; i++) {
final element = styles[i];
final otherElement = otherStyles[i];
if (element.compareTo(otherElement) != RenderComparison.identical) {
return element.compareTo(otherElement);
}
}
return RenderComparison.identical;
}