active_keyboard_language library

Classes

KeyboardAwareDirectionality
Rebuilds with the correct Directionality whenever the active keyboard language changes. Seeds with KeyboardLanguage.getCurrentLanguage so the initial frame is already correct, then follows KeyboardLanguage.onLanguageChanged.
KeyboardLanguage
Detects the active keyboard (IME) language and streams changes.

Functions

isRtlLanguageTag(String? tag) bool
True if tag's primary language subtag is a right-to-left script language (Arabic, Hebrew, Persian, Urdu, Pashto, Sindhi, Central Kurdish, Divehi, Yiddish). Matches on the primary subtag only, so ar-EG, AR, and ar are all treated the same.
normalizeLanguageTag(String? raw) String?
Normalizes a raw platform-provided language tag: lowercase language subtag (remapping legacy Java/Android codes to their modern equivalents), titlecase 4-letter script subtags (e.g. Hans), uppercase 2-letter region subtags. Returns null for null/empty/unparseable input rather than throwing — an odd keyboard tag must never crash the host app.