KeyFeedback enum

How a key press is confirmed to the user, beyond the visual key preview.

A touchscreen gives no tactile confirmation on its own, which is why every system keyboard ships some form of this. On a kiosk or POS terminal it is often the only signal that a tap registered at all.

Defaults to sound, which is what the keyboard has always done: Material's ink response plays the platform key click on Android. Setting this now also covers D-pad activation, which the ink response never reached, so the confirmation no longer depends on how the key was pressed.

Both effects are handled by the platform, so there is no asset to bundle and nothing to configure. Where a platform has no vibration motor or no key click the effect is skipped rather than failing, and both follow the user's system settings including silent mode.

VirtualKeypad(feedback: KeyFeedback.both)   // click and a light vibration
VirtualKeypad(feedback: KeyFeedback.none)   // silent and still
Inheritance
Available extensions

Values

none → const KeyFeedback

No haptic and no sound.

Worth choosing for a kiosk in a quiet room, or where the app plays its own confirmation sound and two would collide.

haptic → const KeyFeedback

A light vibration on each key press, and no sound.

Android and iOS honour the user's system-wide haptics setting, so someone who has turned vibration off still gets what they asked for.

sound → const KeyFeedback

The platform's key click sound, and no vibration. The default.

both → const KeyFeedback

Both a light vibration and the key click sound.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<KeyFeedback>
A constant List of the values in this enum, in order of their declaration.