v2.0.4
keyboard_service
键盘可见性/(自动)隐藏包,无需原生插件
43喜欢 1080近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
键盘可见性/(自动)隐藏包,无需原生插件
以下为英文项目原文快照,最新内容请访问 GitHub。
Keyboard visibility / (auto-) dismiss package without the need of native plugin
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
Also see example project
Wrap your top scaffold:
return KeyboardAutoDismiss(
scaffold: Scaffold(
appBar: AppBar(
title: Text('Keyboard Service Example'),
),
...
),
);
Use the service class if needed:
// 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);
This project is licensed under the MIT License - see the license file for details.
依赖清单 3 项
{"sdk":"flutter"}{"sdk":"flutter"}^6.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗