SoftwareKeyboardHeightSimulator class

A widget that simulates the software keyboard appearance and disappearance.

This works by listening to messages sent from Flutter to the platform that show/hide the software keyboard. In response to those messages, SuperKeyboard emits notifications for the keyboard opening, opened, closing, closed. The timing of those messages are based on an animation in this widget, simulating actual keyboard expansion and collapse. Similarly, this widget installs a MediaQuery, which sets its bottom offsets equal to the simulated keyboard height, which reflects how Flutter actually reports keyboard height to Flutter apps.

Place this widget above the Scaffold in the widget tree.

Inheritance

Constructors

SoftwareKeyboardHeightSimulator({Key? key, required WidgetTester tester, bool isEnabled = true, bool enableForAllPlatforms = false, double keyboardHeight = _defaultKeyboardHeight, bool animateKeyboard = false, required Widget child})
const

Properties

animateKeyboard bool
Whether to simulate keyboard open/closing animations.
final
child Widget
final
enableForAllPlatforms bool
Whether to simulate software keyboard insets for all platforms (true), or whether to only simulate software keyboard insets for mobile platforms, e.g., Android, iOS (false).
final
hashCode int
The hash code for this object.
no setterinherited
isEnabled bool
Whether or not to enable the simulated software keyboard insets.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardHeight double
The vertical space, in logical pixels, to occupy at the bottom of the screen to simulate the appearance of a keyboard.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tester WidgetTester
Flutter's WidgetTester, which is used to intercept platform messages about opening/closing the keyboard.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SoftwareKeyboardHeightSimulator>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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