KeyboardMetrics class

Immutable data class representing keyboard state metrics.

This class contains information about the current keyboard state including its height, the safe area bottom inset, and visibility status.

Use KeyboardMetrics.fromMap to create instances from platform channel data, and KeyboardMetrics.hidden for the default state when the keyboard is not visible.

Constructors

KeyboardMetrics({required double keyboardHeight, required double safeAreaBottom, required bool isKeyboardVisible})
Creates a new KeyboardMetrics instance.
const
KeyboardMetrics.fromMap(Map<String, dynamic> map)
Creates a KeyboardMetrics instance from a platform channel map.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
isKeyboardVisible → bool
Whether the keyboard is currently visible.
final
keyboardHeight → double
The height of the keyboard in logical pixels.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
safeAreaBottom → double
The bottom safe area inset in logical pixels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts this instance to a map suitable for platform channel serialization.
toString() → String
A string representation of this object.
override

Operators

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

Constants

hidden → const KeyboardMetrics
Default metrics representing a hidden keyboard state.