setTreeElementsDivCentered function

void setTreeElementsDivCentered(
  1. Element element,
  2. String className, {
  3. bool centerVertically = true,
  4. bool centerHorizontally = true,
})

Set all element sub div with className to centered content.

Implementation

void setTreeElementsDivCentered(Element element, String className,
    {bool centerVertically = true, bool centerHorizontally = true}) {
  if (isEmptyString(className, trim: true)) return;

  var elements = element.querySelectorAll('div.$className');

  for (var e in elements) {
    if (e is DivElement) {
      setDivCentered(e,
          centerVertically: centerVertically,
          centerHorizontally: centerHorizontally);
    }
  }
}