headingLevel property

int? get headingLevel

The heading level this role represents, or null if it is not a heading.

Implementation

int? get headingLevel => switch (this) {
  heading1 => 1,
  heading2 => 2,
  heading3 => 3,
  heading4 => 4,
  heading5 => 5,
  heading6 => 6,
  _ => null,
};