startsWithRtl static method

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

Determines if the first character in text with strong directionality is RTL. If isHtml is true, the text is HTML or HTML-escaped.

Implementation

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