copyAndReplace static method
List<StyleFamilyState>
copyAndReplace(
- List<
StyleFamilyState> toReplace, - StyleFamilyState replaceWith
Implementation
static List<StyleFamilyState> copyAndReplace(
List<StyleFamilyState> toReplace, StyleFamilyState replaceWith) {
List<StyleFamilyState> newFamilies = [];
for (var styleFamilyState in toReplace) {
if (styleFamilyState.styleFamily.familyName != replaceWith.familyName()) {
newFamilies.add(styleFamilyState);
}
}
newFamilies.add(replaceWith);
return newFamilies;
}