パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.4

keyboard_shortcuts

アプリケーション用のショートカットを使用できるウィジェットです。自分で定義するカスタムショートカットと、下端および上端への自動スクロールなどのグローバルショートカットがあります。

30日間ダウンロード
52
いいね数
47
Pub ポイント
40

パッケージをインストール

flutter pub add keyboard_shortcuts

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterパッケージで、開発者がアプリケーション内でカスタムおよびグローバルキーボードショートカットを実装できるようにします。ユーザーはキーの組み合わせを使ってアクションをトリガーでき、たとえば画面の上部または下部に自動スクロールするなどできます。このパッケージは統合が簡単になるように設計されており、ショートカットを定義・管理するためのシンプルなウィジェットを提供しています。ローカルおよびグローバルなショートカット処理をサポートしており、生産性重視のアプリに最適です。開発者は独自のショートカットロジックを定義することで機能を拡張できます。このパッケージはオープンソースであり、GitHubでメンテナンスされています。

用途

  • ナビゲーションショートカットの実装
  • クイックスクロール操作を有効にする
  • カスタムユーザー定義のホットキーを追加する
  • キーボードナビゲーションによるアクセシビリティの向上
  • 効率的な開発者ツールの作成

主な機能

  • カスタムショートカット定義をサポートしています
  • グローバルおよびローカルのショートカットを処理します
  • 既存のウィジェットとの簡単な統合
  • オープンソースで、積極的にメンテナンスされています
  • ショートカット管理のための明確な API を提供します

適している対象

  • 生産性アプリ
  • 開発者ツール
  • アクセシビリティの向上
  • コンテンツが豊富なインターフェース
  • 高速なナビゲーションを必要とするアプリ

注意事項

  • システムレベルのショートカットと競合する可能性があります
  • フォーカスとコンテキストの適切な処理が必要です
  • すべてのUIパターンに適しているわけではない
  • 制限されたプラットフォーム固有のカスタマイズ
  • さまざまな入力方法でのテストが必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Keyboard Shortcuts

Keyboard shortcuts to add where you want

Example

On controlLeft + key P are pressed, user navigate to SecondPage() helpLabel will be display on help menu

    KeyBoardShortcuts(
        keysToPress: {LogicalKeyboardKey.controlLeft, LogicalKeyboardKey.keyP},
        onKeysPressed: () => Navigator.push(
          context,
          MaterialPageRoute(builder: (context) => SecondPage()),
        ),
        helpLabel: "Go to Second Page",
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.headline4,
              ),
            ],
          ),
        ),
      ),

If globalShortcuts is set to true, user can use Home Button to go on Homepage, up and down button to go on top or bottom of the page and escape to go on last page

    KeyBoardShortcuts(
        globalShortcuts: true,
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.headline4,
              ),
            ],
          ),
        ),
      ),

initShortCuts() is used to customize shortcuts, you can set home page, title of help menu, icon on custom shortcuts and custom help menu

    initShortCuts(HomePage(), helpTitle : "Help Menu", helpIcon : Icons.menu);

You can also use initShortCuts to create your own global shortcuts, they will be allow in all page were globalShortcuts is true without rewriting these shortcuts

  initShortCuts(
    HomePage(),
    keysToPress: {
      {LogicalKeyboardKey.controlLeft, LogicalKeyboardKey.keyP},
    },
    onKeysPressed: {() => print("Work")},
    helpLabel: {"Print Work"},
  );

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト