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

action_process_text 표지
패키지 상세v0.0.6

action_process_text

안드로이드에서 ACTION_PROCESS_TEXT 구현을 위한 플러터 플러그인입니다.

30일 다운로드
115
좋아요
31
Pub 점수
40

패키지 설치

flutter pub add action_process_text

패키지 개요

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

Android에서 ACTION_PROCESS_TEXT 기능을 활성화하는 Flutter 플러그인으로, 앱이 시스템의 텍스트 처리 작업과 통합될 수 있도록 합니다. 선택된 텍스트가 공유, 번역 또는 콘텐츠 분석과 같은 사용자 정의 앱 동작을 트리거할 수 있는 상호작용을 가능하게 합니다. 이 플러그인은 네이티브 Android 기능과 Flutter 애플리케이션을 연결하여 맥락 기반 텍스트 작업을 통해 사용자 인터랙션을 향상시킵니다. 이 플러그인은 Android 전용이며, 표준 Flutter 설정 외에 추가 구성이 필요하지 않습니다.

사용 사례

  • Android에서 사용자 지정 텍스트 작업 통합
  • 컨텍스트 인식 텍스트 처리 활성화
  • Android의 텍스트 선택 메뉴 확장
  • 텍스트 분석 워크플로우 지원
  • 텍스트 선택을 통해 공유 또는 번역 옵션 추가

주요 기능

  • 안드로이드 전용 ACTION_PROCESS_TEXT 지원
  • Flutter와의 원활한 통합
  • 컨텍스트 텍스트 작업 트리거
  • 최소한의 설정 필요
  • 네이티브 안드로이드 동작 에뮬레이션

적합한 대상

  • Android 중심의 Flutter 앱
  • 텍스트 처리 확장
  • 심층적인 안드로이드 통합이 필요한 앱
  • 안드로이드 텍스트 작업을 대상으로 하는 개발자
  • 사용자 정의 가능한 텍스트 상호작용 기능

고려 사항

  • 안드로이드 플랫폼에 제한됨
  • Android SDK 지식 필요
  • iOS 지원 없음
  • 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.

카테고리

소스 저장소

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

아직 데이터가 없습니다.