flutter_keyboard_visibility
adee42/flutter_keyboard_visibility open-source repository details.
- 星标
- 235
- 复刻
- 140
- 最近推送(UTC)
- 2021年3月30日
- 项目状态
- 未归档
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
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.
使用的依赖
依赖清单 1 项
- flutter
{"sdk":"flutter"}
如何选择适合项目的代码仓?
先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
- 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
- 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
- 使用前在 GitHub 核对 README、许可证与 Issues。
来源与维护
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗