搜尋套件、儲存庫與 APP 分類

flutter_interactive_keyboard 封面
套件詳情v0.2.0

flutter_interactive_keyboard

一個 Flutter 外掛,可互動式地關閉鍵盤,類似於 iOS 原生行為。在 Android 上,該功能透過無拖曳方式模擬實現。

AndroidiOS
近 30 天下載
56
喜歡數
33
Pub 分數
140

安裝套件

flutter pub add flutter_interactive_keyboard

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 插件,可實現互動式鍵盤關閉功能,模擬 iOS 的原生拖曳關閉行為。在 iOS 上,使用者可以滑動鍵盤來關閉它。在 Android 上,則透過模擬類似手勢來實現,但不涉及實際的拖曳互動。此插件透過提供跨平台的直覺鍵盤控制,提升使用者體驗,並維持與原生行動行為的一致性。它可輕鬆整合至現有的 Flutter 應用中,設定簡單。

適用情境

  • 表單中的互動式鍵盤關閉
  • 在聊天或輸入密集型應用中提升使用者體驗
  • 在 Android 上模仿 iOS 原生鍵盤手勢
  • 透過手勢控制提升可存取性

主要特色

  • iOS 風格的拖曳關閉手勢
  • Android 手勢模擬
  • 最小整合工作量
  • 跨平台一致性
  • dismissal 期間的平滑動畫

適合對象

  • 針對 iOS 風格 UX 的開發者
  • 頻繁使用鍵盤的應用
  • 以使用者體驗為導向的行動應用程式
  • 表單密集型或訊息介面

使用建議

  • 僅限鍵盤關閉
  • 無觸控靈敏度自訂
  • Android 的行為與真正的拖曳不同
  • 可能與其他手勢檢測器衝突

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

pub package

This plugin is not under active development. If you'd like to contribute, PRs are welcomed.

Flutter Interactive Keyboard

A way to mimic the iOS interactive dismissable keyboard in Flutter. For Android, the behavior will still be applied without animation due to the Android keyboard limitations.

How to use it

The KeyboardManagerWidget defines the area where the draggable keyboard is enabled. Gestures are passed to the widget in order to permit both scrolling and drag-to-dismiss behavior.

focusNode is required when using a TextField to manage the keyboard opening and closing.

See the full example to see a complete implementation.

KeyboardManagerWidget(
  focusNode: _focusNode,
  child: ListView.builder(
    itemCount: 100,
    itemBuilder: (context,index){
      return ListTile(
        title: Text("element $index"),
      );
    },
  ),
)

Advanced

Change focusNode

If your app has more than one TextField that should trigger the keyboard, you can change the current FocusNode from the KeyboardManagerWidgetState as follows:

// Init variable
GlobalKey<KeyboardManagerWidgetState> _key = GlobalKey();

// In the build method
KeyboardManagerWidget(
  key: _key,
  ...
)

// Wherever you like
_key.currentState.substituteFocusNode = newFocusNode;

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。