format method

void format(
  1. EasyAttributeStyles? style, [
  2. bool overrideStylesIfEmpty = false,
  3. bool ignoreMerge = false
])

Formats this EasyText and optimizes it with adjacent EasyTexts if needed.

Implementation

void format(
  EasyAttributeStyles? style, [
  bool overrideStylesIfEmpty = false,
  bool ignoreMerge = false,
]) {
  if (style != null) {
    overrideStylesIfEmpty && style.isEmpty
        ? styles.clearAll()
        : applyStyle(style);
  }
  if (!ignoreMerge) tryMerge();
}