패키지, 저장소 및 앱 카테고리 검색

flutter_keyboard_size 표지
패키지 상세v1.0.1

flutter_keyboard_size

키보드 높이, 열려 있는지 여부, 화면이 작을지 여부를 설정하는 간단하고 편리한 공급자입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2만
좋아요
67
Pub 점수
160

패키지 설치

flutter pub add flutter_keyboard_size

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_keyboard_size는 화면 키보드의 높이와 열려 있는지 여부를 실시간으로 제공하는 가벼운 Flutter 패키지입니다. 또한 화면 크기가 작아서 반응형 UI 조정에 유용한지 확인할 수 있습니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼에서 일관된 동작을 보장하는 간단한 프로바이더 기반 API를 제공합니다. 키보드가 나타나거나 사라질 때 레이아웃을 동적으로 조정해야 하는 앱에 적합합니다.

사용 사례

  • 키보드가 열릴 때 UI 레이아웃 조정
  • 양식에서 키보드 표시 여부 감지
  • 작은 화면을 위한 반응형 디자인
  • 입력 필드 위치 조정 처리
  • 키보드 높이에 기반한 동적 패딩

주요 기능

  • 실시간 키보드 높이 감지
  • 키보드 열림/닫힘 상태 모니터링
  • 화면 크기 분류
  • Provider 기반 상태 관리
  • 크로스 플랫폼 지원
  • 간단한 API 통합

적합한 대상

  • 폼 중심 애플리케이션
  • 채팅 또는 메시지 인터페이스
  • 모바일 우선 사용자 인터페이스
  • 반응형 레이아웃
  • 동적 입력 처리가 필요한 앱

고려 사항

  • 상태 변경 시 재빌드가 필요할 수 있습니다
  • 키보드 관련 메트릭에 한정
  • 복잡한 제스처 감지에 적합하지 않습니다
  • 플랫폼별 키보드 이벤트에 의존합니다
  • Provider와 같은 상태 관리와 함께 사용하는 것이 가장 좋습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_keyboard_size Pub

When the virtual keyboard is opened, we can get its height with MediaQuery.of(context).viewInsets.bottom

BUT, in case of complicated widgets tree, it doesn't work. So, every time we have to mutate the keyboard size down to the widget tree.

This package is a straightforward and convenient provider that helps get info about: keyboard height, is it open or not, set bool value is screen small or not.

Showcase|100x100, 10%

Usage

After installing wrap Scaffold widget to

KeyboardSizeProvider(
      smallSize: 500.0,
      child: Scaffold(

where smallSize property is optional, default is 400.0

After that, down to the widget tree you can use Consumer widget to get info about keyboard

Widget build(BuildContext context) {
    return Consumer<ScreenHeight>(
      builder: (context, _res, child) {
        return Center(

available properties:

  double keyboardHeight
  double screenHeight
  bool isSmall // returns true if screen height becomes less then smallSize property
  bool isOpen // true if open

Full example is here https://github.com/awaik/flutter_keyboard_size/tree/master/example

Credits

This is a project by Agoradesk, P2P cryptocurrency trading platform. Created by the team behind LocalMonero, the biggest and most trusted Monero P2P trading platform.

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트