VirtualKeypad constructor
const
VirtualKeypad({
- Key? key,
- KeyboardType? type,
- TextInputAction? inputAction,
- double height = 280,
- double? width,
- VirtualKeypadTheme theme = VirtualKeypadTheme.light,
- KeyFeedback feedback = KeyFeedback.sound,
- void onKeyPressed(
- VirtualKey key
- void onKeyPressedWithText(
- VirtualKey key,
- String? text
- void onStandaloneInputAction()?,
- List<
String> ? availableLanguages, - String? initialLanguage,
- ValueChanged<
String> ? onLanguageChanged, - KeyboardLayout? customLayout,
- bool enableEmojiKey = false,
- bool showEmojiKeyboardInitially = false,
- TextStyle? emojiTextStyle,
- EmojiFontBytesLoader? colorEmojiFontLoader,
- bool checkEmojiPlatformCompatibility = false,
- bool hideWhenUnfocused = false,
- bool standalone = false,
- ValueChanged<
bool> ? onVisibilityChanged, - Duration animationDuration = const Duration(milliseconds: 200),
- Curve animationCurve = Curves.easeInOut,
- VirtualKeypadKeyBuilder? keyBuilder,
- KeyShuffle keyShuffle = KeyShuffle.none,
- Listenable? shuffleTrigger,
Creates a virtual keyboard.
When standalone is true, the keyboard works with any standard Flutter
TextField or TextFormField without requiring VirtualKeypadScope.
It intercepts Flutter's text input system to route key presses to the
currently focused text field.
Implementation
const VirtualKeypad({
super.key,
this.type,
this.inputAction,
this.height = 280,
this.width,
this.theme = VirtualKeypadTheme.light,
this.feedback = KeyFeedback.sound,
this.onKeyPressed,
this.onKeyPressedWithText,
this.onStandaloneInputAction,
this.availableLanguages,
this.initialLanguage,
this.onLanguageChanged,
this.customLayout,
this.enableEmojiKey = false,
this.showEmojiKeyboardInitially = false,
this.emojiTextStyle,
this.colorEmojiFontLoader,
this.checkEmojiPlatformCompatibility = false,
this.enableDpadNavigation = false,
this.hideWhenUnfocused = false,
this.standalone = false,
this.onVisibilityChanged,
this.animationDuration = const Duration(milliseconds: 200),
this.animationCurve = Curves.easeInOut,
this.keyBuilder,
this.keyShuffle = KeyShuffle.none,
this.shuffleTrigger,
}) : assert(
type != KeyboardType.custom || customLayout != null,
'VirtualKeypad.customLayout is required when type is KeyboardType.custom.',
),
assert(
customLayout == null || type == KeyboardType.custom,
'VirtualKeypad.customLayout can only be used when type is KeyboardType.custom.',
);