device_screenshot
전체 장치의 스크린샷을 찍는 데 도움이 되는 플러터 플러그인입니다.
HasanToufiqAhamed/device_screenshot open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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
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.
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()
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()
의존성 목록 4 개
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗