CustomKeyboardController<T extends Enum> class

A Generic Controller that manages multiple inputs under an enum T. Coordinates selection states, custom keyboard keypress triggers, long-press backspace timers, layout selection, and language states.

Inheritance

Constructors

CustomKeyboardController({required Map<T, TextEditingController> controllers, required Map<T, FocusNode> focusNodes, required Map<T, KeyboardLayout> layouts, KeyboardLanguage defaultLanguage = KeyboardLanguage.vi, bool enableHapticFeedback = true})

Properties

activeLayout KeyboardLayout?
Retrieves the active layout config matching the focused field.
no setter
controllers Map<T, TextEditingController>
Maps each enum field to its text editing controller
final
enableHapticFeedback bool
Gets whether haptic feedback (vibration) is enabled.
getter/setter pair
focusedField → T?
Gets the currently focused field ID, or null if no field is focused.
no setter
focusNodes Map<T, FocusNode>
Maps each enum field to its focus node
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
language KeyboardLanguage
Gets the current language setting.
getter/setter pair
layouts Map<T, KeyboardLayout>
Maps each enum field to its specific layout matrix configuration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearText() → void
Clears all characters from the active text field.
deleteText() → void
Deletes a single character at the cursor position or removes the active selection.
dispose() → void
Discards any resources used by the object.
override
fillSuggestionValue(String rawValue) → void
Fills the active field with a suggestion value, automatically applying thousands formatting.
insertText(String value) → void
Inserts a string at the current cursor position of the active text field. If text selection is active, replaces the selected range.
nextFocus() → void
Switches focus to the next field in the focusNodes map, wrapping back to first.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setLanguage(KeyboardLanguage value) → void
Sets language using a direct method.
startBackspaceRepeating() → void
Starts repeating backspace deletion with a 500ms initial delay and 100ms periodic intervals.
stopBackspaceRepeating() → void
Stops the active backspace timer.
toString() String
A string representation of this object.
inherited
unfocus() → void
Dismisses active focus, triggering keyboard slide-down.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

formatThousands(String val) String
Helper to format raw numeric strings into thousands-grouped notations.