getStyle method

ParagraphStyle getStyle()

Gets the style applied to this paragraph. If styleName is null or not found, returns the "normal" style.

Implementation

ParagraphStyle getStyle() {
  if (styleName == null) return ParagraphStyle.normal;
  return ParagraphStyle.predefinedStyles.firstWhere(
    (s) => s.name == styleName,
    orElse: () => ParagraphStyle.normal,
  );
}