styleFor method

TextStyle styleFor(
  1. Style lineStyle
)

Returns effective style to use for inline code for the specified lineStyle.

Implementation

TextStyle styleFor(Style lineStyle) {
  if (lineStyle.containsKey(Attribute.h1.key)) {
    return header1 ?? style;
  }
  if (lineStyle.containsKey(Attribute.h2.key)) {
    return header2 ?? style;
  }
  if (lineStyle.containsKey(Attribute.h3.key)) {
    return header3 ?? style;
  }
  if (lineStyle.containsKey(Attribute.h4.key)) {
    return header4 ?? style;
  }
  if (lineStyle.containsKey(Attribute.h5.key)) {
    return header5 ?? style;
  }
  if (lineStyle.containsKey(Attribute.h6.key)) {
    return header6 ?? style;
  }
  return style;
}