KeyboardState class

What the guest says about its keyboard: what it was told, what the app asked for, and what is actually on screen.

The last two are separate facts and reporting only one of them is how a control ends up lying. requested is the app's opinion — a field has focus — and height is what the screen lost, which is zero whenever the mode overrules the app.

Constructors

KeyboardState({KeyboardMode mode = KeyboardMode.auto, bool requested = false, KeyboardVariant variant = KeyboardVariant.letters, double height = 0, double deviceHeight = 0})
const
KeyboardState.fromJson(Map<String, Object?> json)
factory

Properties

deviceHeight → double
What this device's keyboard measures when it is up — the number the host pushed. Non-zero even while the keyboard is down, which is what lets a host draw a control that says how much raising it would cost.
final
hashCode → int
The hash code for this object.
no setteroverride
height → double
What the screen actually lost, in logical pixels. Zero when the keyboard is down.
final
mode → KeyboardMode
final
requested → bool
Whether the app has a field focused — the show() with no hide() after it. True regardless of mode, because it is what the app said rather than what was done with it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
up → bool
no setter
variant → KeyboardVariant
Which keyboard is on screen — what the focused field asked for, and letters where nothing did.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
override

Operators

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