Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gerrel/keyboard_service
Keyboard visibility / (auto-) dismiss package without native plugin
https://github.com/gerrel/keyboard_service
android dart flutter ios keyboard keyboard-visibility mobile
Last synced: about 1 month ago
JSON representation
Keyboard visibility / (auto-) dismiss package without native plugin
- Host: GitHub
- URL: https://github.com/gerrel/keyboard_service
- Owner: Gerrel
- License: mit
- Created: 2020-01-30T10:40:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-21T17:28:43.000Z (over 2 years ago)
- Last Synced: 2024-10-01T16:39:47.139Z (about 2 months ago)
- Topics: android, dart, flutter, ios, keyboard, keyboard-visibility, mobile
- Language: Dart
- Homepage:
- Size: 80.1 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# keyboard_service
Keyboard visibility / (auto-) dismiss package without the need of native plugin
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![pub package](https://img.shields.io/pub/v/keyboard_service.svg)](https://pub.dev/packages/keyboard_service)## Getting Started
Use it for example when you want to automatically dimiss the on-screen keyboard when tapped outside of textfield.
And if you want know if the on-screen keyboard is visible and/or want to explicitly dismiss it.There are 2 classes
- 'KeyboardService': Check if keyboard is visible and dismiss keyboard.
- 'KeyboardAutoDismiss': A widget that wraps a Scaffold widget for automatically dismissing the keyboard.`Also see example project`
Wrap your top scaffold:
```dart
return KeyboardAutoDismiss(
scaffold: Scaffold(
appBar: AppBar(
title: Text('Keyboard Service Example'),
),
...
),
);
```Use the service class if needed:
```dart
// Use method below to dismiss the keyboard
KeyboardService.dismiss();// Use the optional BuildContext parameter to remove focus of a TextField
KeyboardService.dismiss(unfocus: context);// Check if the keyboard is visible
KeyboardService.isVisible(context);```
## License
This project is licensed under the MIT License - see the
[license] file for details.[license]: https://github.com/Gerrel/keyboard_service/blob/master/LICENSE
[github-watch-badge]: https://img.shields.io/github/watchers/Gerrel/keyboard_service.svg?style=social
[github-watch]: https://github.com/Gerrel/keyboard_service/watchers
[github-star-badge]: https://img.shields.io/github/stars/Gerrel/keyboard_service.svg?style=social
[github-star]: https://github.com/Gerrel/keyboard_service/stargazers
[releases]: https://github.com/Gerrel/keyboard_service/releases