mobileKeyBoardListener method
Future<void>
mobileKeyBoardListener({
- dynamic onHeight(
- num height
- dynamic onShow(
- KeyboardStatus status
override
Implementation
@override
Future<void> mobileKeyBoardListener({Function(num height)? onHeight, Function(KeyboardStatus status)? onShow}) async {
eventChannel.receiveBroadcastStream().listen(
(event) {
if (event["height"] is num) {
if (onHeight != null) {
onHeight(event["height"]);
}
}
if (event["status"] is int) {
if (onShow != null) {
onShow(KeyboardStatus.values[event["status"]]);
}
}
},
onDone: () {
if (kDebugMode) print("键盘监听移除");
},
onError: (e) {
if (kDebugMode) print("键盘监听报错-----$e");
},
);
}