isUnicodeWhitespace function

bool isUnicodeWhitespace(
  1. int rune
)

Set of code points treated as whitespace by findUnicodeClassType.

This is the pure-Dart replacement for the removed quiver.isWhitespace dependency. It covers the ASCII whitespace controls plus the Unicode space separators that String.trim does not always remove, so the ignoreWhitespace scan behaves consistently across every flavor of space.

Edge cases:

  • Returns false for every non-whitespace rune, including BMP letters and astral code points, so it is safe to call on any rune.

Example:

isUnicodeWhitespace(0x20);   // true  (space)
isUnicodeWhitespace(0x202F); // true  (narrow no-break space)
isUnicodeWhitespace(0x41);   // false ('A')

Audited: 2026-06-12 11:26 EDT

Implementation

bool isUnicodeWhitespace(int rune) => _whitespaceRunes.contains(rune);