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

패키지 상세v0.3.0

keyboard_height_plugin

키보드가 표시되기 전에 키보드 높이를 방출하는 플러터 플러그인 (ios/android)

AndroidiOS
30일 다운로드
4.1만
좋아요
31
Pub 점수
150

패키지 설치

flutter pub add keyboard_height_plugin

패키지 개요

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

keyboard_height_plugin은 Android 및 iOS 기기에서 화면 키보드가 나타나기 전에 키보드 높이에 대한 실시간 업데이트를 제공하는 Flutter 패키지입니다. 키보드가 표시되기 직전에 키보드 높이를 방출함으로써 개발자가 UI 레이아웃을 동적으로 조정하여 사용자 경험을 향상시킬 수 있습니다. 이 플러그인은 내용이 키보드에 가려질 수 있는 양식이나 입력 필드에 특히 유용합니다. 두 주요 모바일 플랫폼에서 원활하게 작동하며 pub.dev를 통해 쉽게 통합할 수 있습니다. 이 플러그인은 가볍고 추가 기능 없이 키보드 높이 감지에만 집중합니다.

사용 사례

  • 동적 폼 레이아웃 조정
  • 입력 필드 겹침 방지
  • 실시간 UI 반응성
  • 모바일 앱 키보드 인식
  • 입력 중 화면 공간 최적화

주요 기능

  • 표시 전에 키보드 높이를 방출합니다
  • 크로스 플랫폼(안드로이드 및 iOS)
  • 경량이고 집중된
  • pub.dev를 통한 간단한 통합
  • 추가 종속성 없음

적합한 대상

  • 입력 중심 앱을 개발하는 개발자
  • 반응형 UI가 필요한 앱
  • 폼 기반 모바일 애플리케이션
  • 정밀한 키보드 피드백이 필요한 프로젝트
  • iOS 및 Android를 대상으로 하는 Flutter 앱

고려 사항

  • 레이아웃 변경에 대한 수동 처리가 필요합니다
  • 키보드 높이만 제한
  • 사용자 정의 키보드를 지원하지 않습니다
  • 내장 애니메이션 지원 없음
  • 추가 상태 관리가 필요할 수 있습니다

원본 README

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

Keyboard Height Plugin for Flutter

keyboard_height_plugin is a Flutter plugin for iOS and Android that provides the keyboard size before the keyboard animation occurs for showing or hiding it. This helps eliminate lag when positioning widgets around the keyboard, such as placing a TextField above the keyboard.

Requirements

Version 0.3.0+ (Current)
  • Android:
    • Android Gradle Plugin (AGP) 8.6.0+
    • Gradle 8.7+
    • Kotlin 2.1.0+
    • Java 17+
    • minSdkVersion 16 (Android 4.1+)
    • compileSdkVersion 34+
  • iOS:
    • iOS 12.0+
    • Supports both CocoaPods and Swift Package Manager
    • Includes Privacy Manifest for App Store compliance
Version 0.1.5 (Legacy Support)

For projects that cannot upgrade to the modern build tools, use version 0.1.5:

  • Android Gradle Plugin 7.x
  • Kotlin 1.7.x
  • Java 11+

Installation

To install keyboard_height_plugin, add it to your pubspec.yaml file under the dependencies section:

dependencies:
  keyboard_height_plugin: ^0.3.0

For legacy projects:

dependencies:
  keyboard_height_plugin: 0.1.5

Usage

To use the keyboard_height_plugin, first import it in your Dart file:

import 'package:keyboard_height_plugin/keyboard_height_plugin.dart';

Next, create a stateful widget and declare a variable to store the keyboard height and create an instance of the KeyboardHeightPlugin:

class _HomePageState extends State<HomePage>; {
  double _keyboardHeight = 0;
  final KeyboardHeightPlugin _keyboardHeightPlugin = KeyboardHeightPlugin();
  // ... rest of code ...
}

Then, initialize the KeyboardHeightPlugin in your initState method and listen for changes in the keyboard height:

@override
void initState() {
  super.initState();
  _keyboardHeightPlugin.onKeyboardHeightChanged((double height) {
    setState(() {
      _keyboardHeight = height;
    });
  });
}

Use the _keyboardHeight variable to position your widgets around the keyboard.

Example

For a complete example on how to use the keyboard_height_plugin, please refer to the example directory in the repository.

Contributing

If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the project's GitHub repository.

License

This plugin is licensed under the BSD 3-Clause License.

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

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