FLUTTER ECOSYSTEM

Gerrel/keyboard_service

키보드 표시 여부 / (자동) 숨김 패키지, 네이티브 플러그인 없음

keyboard_service 프로젝트 이미지
Stars
10
Forks
1
최근 푸시(UTC)
2025. 8. 5.
프로젝트 상태
활성
Gerrel GitHub avatar
GITHUB User

Gerrel ↗

The Netherlands
언어DartPythonKotlinSwiftObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • lints개발 의존성^6.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

keyboard_service

Keyboard visibility / (auto-) dismiss package without the need of native plugin

Watch on GitHub Star on GitHub pub package

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:

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);

License

This project is licensed under the MIT License - see the license file for details.