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

flutter_process_text 표지
패키지 상세v1.1.2

flutter_process_text

프로세스 텍스트 스트림을 수신하여 지속적인 프로세스 텍스트 인텐트 데이터를 얻기 위한 Flutter 플러그인입니다.

AndroidiOS
30일 다운로드
60
좋아요
35
Pub 점수
150

패키지 설치

flutter pub add flutter_process_text

패키지 개요

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

프로세스 텍스트 스트림을 수신할 수 있도록 해주는 플러터 플러그인으로, 외부 소스로부터 지속적인 인텐트 데이터를 앱이 받을 수 있게 합니다. 안드로이드와 iOS용으로 설계되어 시스템 레벨의 텍스트 처리 워크플로우와 원활하게 통합되도록 합니다. 실시간으로 텍스트 인텐트를 캡처하여 클립보드 모니터링, 텍스트 공유 또는 다른 앱의 텍스트 출력과의 통합과 같은 사용 사례에 적합합니다. 단순성과 크로스플랫폼 호환성을 고려해 개발되었으며, 개발자가 들어오는 텍스트 스트림에 접근할 수 있는 간단한 API를 제공합니다.

사용 사례

  • 클립보드 모니터링
  • 텍스트 공유 통합
  • 실시간 텍스트 처리
  • 앱 간 텍스트 통신
  • 의도 기반 데이터 캡처

주요 기능

  • 실시간 텍스트 스트림 듣기
  • 크로스 플랫폼 지원 (Android 및 iOS)
  • 의도 데이터를 위한 간단한 API
  • 지속적인 텍스트 흐름을 지원
  • 내장 스트림 처리

적합한 대상

  • 텍스트 공유 앱을 개발하는 개발자
  • 클립보드 상호작용이 필요한 앱
  • 의도 기반 애플리케이션
  • 크로스 플랫폼 텍스트 처리 도구
  • 생산성 또는 자동화용 플러그인

고려 사항

  • Android에서 적절한 권한이 필요합니다
  • 텍스트 의도 데이터만 제한
  • 백그라운드 실행 설정이 필요할 수 있습니다
  • 의도하지 않은 텍스트 소스에는 적합하지 않습니다
  • iOS는 백그라운드 기능이 제한될 수 있습니다

원본 README

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

Flutter Process Text Plugin

Flutter_Process_Text

GitHub GitHub code size in bytes GitHub language count GitHub last commit

Compatibility

✅   Android
❌   iOS (active issue: iOS support)

Show some :heart: and :star: the repo

GitHub followers

Why use Flutter Process Text?

Flutter Process Text Plugin is known for :

Flutter Process Text Flutter Process Text
Fast, performant & compatible Free & Open-source
Production ready Make App Reactive

Features

✅   Listen process text stream
✅   Open app from process text intent activity
✅   Get pending intent text


Demo

App Running App Not Running
App Running AppNotRunning

Quick start

Step 1: Include plugin to your project
dependencies:
  flutter_process_text: <latest version>

Run pub get and get packages.

Step 2: Create a new activity

Add the below code to your AndroidManifest.xml in the android\app\src\main\ folder.

  <activity 
        android:name=".ProcessTextActivity" 
        android:label="Process_Text"
        android:theme="@android:style/Theme.NoDisplay">
          <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>

Note: You may change the android:name from ProcessTextActivity to anything you want. also change the android:label from Process_Text to the process action text that you want to display.

Step 3: Create new activity class

Create a new Java/Kotlin file with the same name as android:name in step 2.

Copy the below code and paste in the newly created file.

package com.divyanshushekhar.flutter_process_text_example;

import com.divyanshushekhar.flutter_process_text.FlutterProcessTextPlugin;
import io.flutter.embedding.android.FlutterActivity;
import android.os.Bundle;

public class ProcessTextActivity extends FlutterActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        boolean issAppRunning = MainActivity.getIsAppRunning();
        FlutterProcessTextPlugin.listenProcessTextIntent(issAppRunning);
    }
}

Note: Don't forget to change the package name in the above code.

Step 4: Changes in MainActivity

Make the necessary changes in the MainActivity class.

package com.divyanshushekhar.flutter_process_text_example;

import io.flutter.embedding.android.FlutterActivity;

import android.app.ActivityManager;
import android.content.Context;
import android.os.Bundle;
import java.util.List;

public class MainActivity extends FlutterActivity {
   private static boolean isAppRunning;

   public static boolean getIsAppRunning() {
     return isAppRunning;
   }

   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
        isAppRunning = isAppRunning(this);
   }

    public static boolean isAppRunning(Context context) {
        final String packageName = context.getPackageName();
        final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        final List<ActivityManager.RunningAppProcessInfo> processInfo = activityManager.getRunningAppProcesses();
        if (processInfo != null)
        {
            for (final ActivityManager.RunningAppProcessInfo info : processInfo) {
                if (info.processName.equals(packageName)) {
                    return true;
                }
            }
        }
        return false;
    }
}
Step 5: Connect to flutter

First thing you need to do is to call the initialize method from the FlutterProcessText class in the initState() {} of the page.

FlutterProcessText.initialize();

OR

FlutterProcessText.initialize(
    showConfirmationToast: true,
    showRefreshToast: true,
    showErrorToast: true,
    confirmationMessage: "Text Added",
    refreshMessage: "Got all Text",
    errorMessage: "Some Error",
);
Step 6: Working with stream

There are two ways to work with stream, either create a StreamSubscription to listen for the incoming data or store the Stream and use it in StreamBuilder.

  late final StreamSubscription _processText;
  String text? = '';

  @override
  void initState() {
    super.initState();
    FlutterProcessText.initialize(
      showToast: true,
      confirmationMessage: "Text Added",
      refreshMessage: "Got all Text",
      errorMessage: "Some Error",
    );

    _processText = FlutterProcessText.getProcessTextStream.listen((event) {
      setState(() {
        text = event;
      });
    });
  }

  @override
  void dispose() {
    super.dispose();
    _processText.cancel();
  }

OR

late final Stream<String> _processText;
_processText = FlutterProcessText.getProcessTextStream;

Now use the stream in the StreamBuilder.

StreamBuilder<String?>(
  stream: _processText,
  builder: (context, snapshot) {
    return Text('Fetched Data: ${snapshot.data}');
  },
),
Get pending data

Get the pending data by calling the refreshProcessText method in FlutterProcessText class.

String? text = await FlutterProcessText.refreshProcessText;

Project Created & Maintained By

Divyanshu Shekhar

Copyright & License

Code and documentation Copyright (c) 2021 Divyanshu Shekhar. Code released under the BSD 3-Clause License.

카테고리

소스 저장소

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

아직 데이터가 없습니다.