flutter_keyboard_visibility
adee42/flutter_keyboard_visibility open-source repository details.
- Stars
- 235
- Forks
- 140
- Last push (UTC)
- Mar 30, 2021
- Project status
- Active
Original README
English project snapshot. Visit GitHub for the latest content.
keyboard_visibility
Notification service for soft-keyboard visibility
Usage
Add the dependency to your pubspec.yaml file in the root folder of your project. Look for the 'dependencies:'-line and add the following line after this line:
keyboard_visibility: any
or
keyboard_visibility: ^[CURRENT VERSION NUMBER]
(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. For additional documentation about the pubspec.yaml file please refer to the official flutter documentation using packages
Import package:keyboard_visibility/keyboard_visibility.dart, instantiate KeyboardVisibilityNotification
and use the Android and iOS notifications to get events about changes of the visibility of the soft-keyboard
The best practice to call the addNewListener function is inside the initState function as in the following example:
import 'package:keyboard_visibility/keyboard_visibility.dart';
@protected
void initState() {
super.initState();
KeyboardVisibilityNotification().addNewListener(
onChange: (bool visible) {
print(visible);
},
);
}
Also check out the example included with the package
Getting Started
For help getting started with Flutter, view the following online documentation.
Dependencies used
Dependency list 1 items
- flutter
{"sdk":"flutter"}
How do I choose a repository?
Start with your use case, compare repository activity, and check the original project before adopting it.
- Search by repository name, owner or description, then narrow the results by topic.
- Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
- Read the README, license and issues on GitHub before using a project.
Sources and maintenance
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗