getMarksTextStyles static method

TextStyle getMarksTextStyles(
  1. List<Mark> marks,
  2. Map<dynamic, TextStyle> renderMark
)

Implementation

static TextStyle getMarksTextStyles(
    List<Mark> marks, Map<dynamic, TextStyle> renderMark) {
  Map<String, TextStyle?> textStyles = {};
  marks.forEach((Mark mark) {
    textStyles.putIfAbsent(mark.type, () => renderMark[mark.type]);
  });
  return TextStyle(
    fontWeight: textStyles['bold']?.fontWeight,
    fontStyle: textStyles['italic']?.fontStyle,
    decoration: textStyles['underline']?.decoration,
  );
}