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

action_process_text のカバー
パッケージ詳細v0.0.6

action_process_text

Android での ACTION_PROCESS_TEXT 実装用の Flutter プラグイン。

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

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

flutter pub add action_process_text

パッケージ概要

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

AndroidでACTION_PROCESS_TEXT機能を有効にするFlutterプラグインであり、アプリがシステムのテキスト処理アクションと統合できるようにします。選択されたテキストが、共有、翻訳、コンテンツの分析など、カスタムアプリ動作をトリガーするような相互作用を可能にします。このプラグインはネイティブなAndroid機能とFlutterアプリケーションを橋渡しし、コンテキストに応じたテキスト操作を通じてユーザーインタラクションを強化します。このプラグインはAndroid専用であり、標準的なFlutterセットアップ以外に追加の構成は必要ありません。

用途

  • Android でのカスタムテキストアクションの統合
  • コンテキストに応じたテキスト処理の有効化
  • Android のテキスト選択メニューの拡張
  • テキスト分析ワークフローのサポート
  • テキスト選択による共有または翻訳オプションの追加

主な機能

  • Android 固有の ACTION_PROCESS_TEXT のサポート
  • Flutterとのシームレスな統合
  • コンテキストテキスト操作のトリガー
  • 最小限のセットアップが必要
  • ネイティブAndroid動作のエミュレーション

適している対象

  • Android向けのFlutterアプリ
  • テキスト処理拡張
  • 深くAndroid統合が必要なアプリ
  • Androidテキスト操作をターゲットにする開発者
  • カスタマイズ可能なテキストインタラクション機能

注意事項

  • Android プラットフォームに限定
  • Android SDK の知識が必要です
  • iOS サポートなし
  • Android システムの動作に依存します
  • Androidのバージョン間でテストが必要になる可能性があります

元の README

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

ACTION_PROCESS_TEXT Flutter

A flutter plugin for ACTION_PROCESS_TEXT implementation in android.

What is it used for?

It can be used when you want your users to use a shortcut for opening your app when selecting text anywhere in the android environment.

Constraints

1. It works only for android.
2. It can only be used inside a Stateful widget.
3. Use setState() after updating the value from the action.

Include in your project

dependencies:
  action_process_text: <latest version>

Run pub get and get packages.

Add this to AndroidManifest.xml in the android\app\src\main\ folder.

  <activity android:name="com.example.action_process_text.ActionProcessTextPlugin"
            android:label="Action_Text" android:theme="@style/LaunchTheme">
            <intent-filter>
                <action android:name="android.intent.action.PROCESS_TEXT" />
                <data android:mimeType="text/plain"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
   </activity>

Change the android:label from Action_Text to the action text that you want to display.

Then import the package to use it.

import 'package:action_process_text/action_process_text.dart';

Usage

Use the constructor of the widget to initialize the action_process_text. ActionProcessText.getInputText is used to get the selected text from the android action.

class MainPage extends StatefulWidget {
  @override
  _MainPageState createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  _MainPageState() {
    initActionProcessText();
  }

  Future<void> initActionProcessText() async {
    inputText = await ActionProcessText.getInputText;
    setState(() {});
  }

  String inputText = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold();
  }
  }

If you want to check whether the call was made from the native side, you can use the ActionProcessText.calledFromNative . This enables one to navigate to a different screen than usual if needed, by initiating the channel at the start and check if the value is true. If true, the input text will be available. When it's false, the app is opened not by the action_process_text intend, but by the user as in usual cases.

Bugs/Requests

If you encounter any problems feel free to open an issue. Pull request are also welcome.

カテゴリー

ソースリポジトリ

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

データはまだありません。