hasAnyLtr method Null safety

bool hasAnyLtr(
  1. String text,
  2. [dynamic isHtml = false]
)

Determines if the given text has any LTR characters in it. If isHtml is true, the text is HTML or HTML-escaped.

Implementation

static bool hasAnyLtr(String text, [isHtml = false]) {
  return RegExp(r'[' '$_LTR_CHARS' r']')
      .hasMatch(isHtml ? stripHtmlIfNeeded(text) : text);
}