flutter_keyboard_visibility 0.8.0 flutter_keyboard_visibility: ^0.8.0 copied to clipboard
Flutter plugin for discovering the state of the soft-keyboard visibility on Android and iOS.
Flutter Keyboard Visibility #
Notification service for keyboard visibility. This is a fork, original project here.
Install #
Add the dependency to your pubspec.yaml
dependencies:
flutter_keyboard_visibility: ^0.7.0
(Please note that the two spaces in the beginning of the line are important)
Run flutter packages get
in your root folder after saving the pubspec.yaml file.
Usage #
Import package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart
The best practice to call the addNewListener function is inside the initState function as in the following example:
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
@override
void initState() {
super.initState();
KeyboardVisibilityNotification().addNewListener(
onChange: (bool visible) {
print(visible);
},
);
}