Search packages, repositories and app categories

Package detailsv0.0.8

device_screenshot

A Flutter plugin that can helps you to take screenshot your overall device.

Android
30-day downloads
61
Likes
9
Pub points
150

Install package

flutter pub add device_screenshot

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The device_screenshot package is a Flutter plugin designed to capture screenshots of the entire device screen on Android. It enables developers to programmatically take full-device screenshots, useful for testing, debugging, or generating visual reports. The plugin integrates seamlessly with Flutter applications and requires no additional native code setup beyond standard configuration. It supports Android platforms and is ideal for scenarios where visual validation or automated screenshot generation is needed.

Use cases

  • Automated UI testing
  • Debugging visual issues
  • Generating app previews
  • Creating visual documentation
  • Recording app states

Key features

  • Captures full device screen
  • Android-only support
  • Simple API integration
  • No native code required
  • Works in background

Suitable for

  • Test automation engineers
  • UI/UX developers
  • App debuggers
  • Documentation creators
  • Quality assurance teams

Considerations

  • Limited to Android platform
  • Requires runtime permissions
  • May not work on all devices
  • Potential performance impact during capture
  • Not suitable for iOS development

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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()

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.0.2

Source repository

Projects using this package

No data available yet.