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

パッケージ詳細v0.0.8

device_screenshot

Flutterプラグインで、デバイス全体のスクリーンショットを撮影できます。

Android
30日間ダウンロード
61
いいね数
9
Pub ポイント
150

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

flutter pub add device_screenshot

パッケージ概要

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

device_screenshot パッケージは、Android 上でデバイス画面全体のスクリーンショットを撮影するように設計されたFlutterプラグインです。開発者がプログラム的に完全なデバイススクリーンショットを取得できるようにし、テスト、デバッグ、または視覚的なレポート作成に役立ちます。このプラグインはFlutterアプリケーションとシームレスに統合され、標準構成以外の追加のネイティブコード設定は必要ありません。Androidプラットフォームをサポートしており、視覚的検証や自動スクリーンショット生成が必要な場面に最適です。

用途

  • 自動化UIテスト
  • 視覚的問題のデバッグ
  • アプリプレビューの生成
  • ビジュアルドキュメンテーションの作成
  • 録音アプリの状態

主な機能

  • デバイスの全画面をキャプチャする
  • Android専用のサポート
  • シンプルな API インテグレーション
  • ネイティブコードは不要です
  • バックグラウンドで動作

適している対象

  • テスト自動化エンジニア
  • UI/UX開発者
  • アプリデバッガー
  • ドキュメント作成者
  • 品質保証チーム

注意事項

  • Android プラットフォームに限定
  • 実行時権限が必要です
  • すべてのデバイスで動作しない可能性があります
  • キャプチャ中のパフォーマンスへの潜在的な影響
  • iOS開発には適していません

元の README

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

Device Screenshot Banner

Device Screenshot

💡 Overview

A Flutter plugin that can helps you to take screenshot your overall device using media projection and foreground service.

The plugin currently supports Android only and doesn't support IOS because the feature of media projection is not available there

💻 Usage

First, add device_screenshot as a dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter

  device_screenshot: ^update_version

Don't forget to flutter pub get.

🔧 Setup

Set the minimum SDK version to 21 or higher in your android/app/build.gradle file:

android {
    defaultConfig {
        ...
        minSdkVersion 21 // Set this to 21 or higher
        ...
    }
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="...">
  ...

  <application
        ...
        ...>

        <activity
            ...
            ...>

        <!--Add this-->
        <service
            android:name="com.flutter.device_screenshot.src.MediaProjectionService"
            android:enabled="true"
            android:exported="false"
            android:foregroundServiceType="mediaProjection"
            android:permission="TODO"
            android:stopWithTask="false"
            />
        <!--end-->

        ...
  ...
  </application>
</manifest>

Import the package:

import 'package:device_screenshot/device_screenshot.dart';

Use the singleton instance of DeviceScreenshot to access all the available methods, for example:

DeviceScreenshot.instance.checkMediaProjectionService()

📱 To take screenshot

At first you need to run foreground service and for this

DeviceScreenshot.instance.requestMediaProjection()

Now you are ready to take your Device Screenshot.

Uri? uri = await DeviceScreenshot.instance.takeScreenshot()

カテゴリー

依存関係

依存関係一覧 1 件

  • plugin_platform_interface^2.0.2

ソースリポジトリ

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

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