KeyboardLanguage class

Defines all keyboard layouts for a specific language.

Each language provides layouts for different input types (text, email, etc.). This allows the keyboard to switch layouts based on both the active input type and the selected language.

Example:

final english = KeyboardLanguage(
  code: 'en',
  name: 'English',
  nativeName: 'English',
  textLayouts: KeyboardLayoutSet(
    primary: qwertyLayout,
    secondary: numbersLayout,
    tertiary: symbolsLayout,
  ),
  emailLayouts: KeyboardLayoutSet(
    primary: emailQwertyLayout, // with @ on first page
    secondary: numbersLayout,
    tertiary: symbolsLayout,
  ),
);

Constructors

KeyboardLanguage({required String code, required String name, required String nativeName, required KeyboardLayoutSet textLayouts, KeyboardLayoutSet? emailLayouts, KeyboardLayoutSet? urlLayouts, KeyboardLayoutSet? numberLayouts, KeyboardLayoutSet? numberSignedLayouts, KeyboardLayoutSet? numberDecimalLayouts, KeyboardLayoutSet? phoneLayouts, bool isRTL = false})
Creates a keyboard language definition.
const

Properties

code → String
ISO 639-1 language code (e.g., 'en', 'bn', 'ar').
final
emailLayouts → KeyboardLayoutSet?
Layouts for email input (with @ accessible). Falls back to textLayouts.
final
hashCode → int
The hash code for this object.
no setteroverride
isRTL → bool
Whether the language is right-to-left (RTL), such as Arabic.
final
name → String
English name of the language (e.g., 'Bengali').
final
nativeName → String
Native name of the language (e.g., 'বাংলা').
final
numberDecimalLayouts → KeyboardLayoutSet?
Layouts for decimal number input (with . key). Falls back to numberLayouts.
final
numberLayouts → KeyboardLayoutSet?
Layouts for number input. Falls back to a standard number pad.
final
numberSignedLayouts → KeyboardLayoutSet?
Layouts for signed number input (with - key). Falls back to numberLayouts.
final
phoneLayouts → KeyboardLayoutSet?
Layouts for phone input. Falls back to a standard phone dialer.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textLayouts → KeyboardLayoutSet
Layouts for general text input.
final
urlLayouts → KeyboardLayoutSet?
Layouts for URL input (with /, :, . accessible). Falls back to textLayouts.
final

Methods

getLayoutsForType(KeyboardInputType inputType) → KeyboardLayoutSet
Gets the appropriate layout set for the given input type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override