isInlineElement function

bool isInlineElement(
  1. DivElement element, {
  2. bool checkBootstrapClasses = true,
})

Returns true if element display property is inline.

Implementation

bool isInlineElement(DivElement element, {bool checkBootstrapClasses = true}) {
  if (element.style.display.toLowerCase().contains('inline')) return true;

  if (checkBootstrapClasses) {
    return element.classes.contains('d-inline') ||
        element.classes.contains('d-inline-block') ||
        element.classes.contains('d-inline-flex');
  }

  return false;
}