findTextStyleName method
inspect the named text styles for a match, and return the name of that matching style
Implementation
TextStyleName? findTextStyleName(AppInfoModel appInfo, TextStyleProperties props) {
for (TextStyleName tsName in appInfo.userTextStyles.keys) {
TextStyleProperties namedTSProps = appInfo.userTextStyles[tsName]!;
if (namedTSProps.color == props.color &&
namedTSProps.fontWeight == props.fontWeight &&
namedTSProps.fontSize == props.fontSize &&
namedTSProps.fontSizeName == props.fontSizeName &&
namedTSProps.fontFamily == props.fontFamily &&
namedTSProps.fontStyle == props.fontStyle &&
namedTSProps.letterSpacing == props.letterSpacing &&
namedTSProps.lineHeight == props.lineHeight) {
return tsName;
}
}
return null;
}