v3.0.0keyboard_dismisser
손짓을 키보드 외부에서 수행할 때 키보드를 숨기는 간단한 플러터 패키지입니다.
손짓을 키보드 외부에서 수행할 때 키보드를 숨기는 간단한 플러터 패키지입니다.
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A simple Flutter package to hide the keyboard when performing a gesture outside of it.
Example
GestureDetector.This package exposes a KeyboardDismisser stateless widget. You can wrap your widget with it, and
your widget will be able to dismiss the keyboard when performing a gesture.
Widget build(BuildContext context) => KeyboardDismisser(
child: Scaffold(
body: ...,
),
);
KeyboardDismisser takes a gestures parameter, which is a list of GestureType enum cases. This
way, you can pass any gesture you like for the keyboard dismissal. By default, KeyboardDismisser
will dismiss the keyboard when tapping outside of it, but it handles several gestures at the
same time.
Widget build(BuildContext context) => KeyboardDismisser(
gestures: [GestureType.onTap, GestureType.onPanUpdateDownDirection],
child: Scaffold(
body: ...,
),
);
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
keyboard_dismisser: "^[LATEST_VERSION]"
Then run $ flutter pub get. In your library, add the following import:
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
Diego Rogel - GitHub
Check the Changelog page to see what's recently changed.
This project is licensed under the MIT License - see the LICENSE file for details.