wrapWithSpan method

String wrapWithSpan({
  1. TextDirection textDirection = textDirectionUNKNOWN,
  2. bool isHtml = false,
  3. bool resetDir = true,
})

Wraps the text with a span tag and sets the direction attribute (dir) based on the provided or estimated direction.

If textDirection is not provided, it estimates the text direction.

If isHtml is false, the text is HTML-escaped.

If resetDir is true and the overall directionality or the exit directionality of the text is opposite to the context directionality, a trailing unicode BiDi mark matching the context directionality is appended (LRM or RLM).

Implementation

String wrapWithSpan({
  TextDirection textDirection = textDirectionUNKNOWN,
  bool isHtml = false,
  bool resetDir = true,
}) {
  return textDirection.toBidiFormatter().wrapWithSpan(
        this,
        isHtml: isHtml,
        resetDir: resetDir,
        direction: textDirection,
      );
}