native_screenshot 0.0.2+1 native_screenshot: ^0.0.2+1 copied to clipboard
A simple plugin to take screenshots using native code (iOS & Android).
This plugin aims to be a simple one that implements taking screenshot natively to capture scenes like camera preview or AR views. This cannot be done easily in plain Flutter, at least I cannot make it work using
RenderRepaintBoundary and similar techniques.
The main difference with another packages is that they shows a share dialog. This plugin saves the image and returns the path to it. On Android also launch an updating request (internally) to reload the media library.
You must add
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Import the library:
and take a screenshot:
String path = NativeScreenshot.takeScreenshot()
In error case the function returns
null and the screenshot path if success.
This is based on screenshot_share_image and capture_and_share packages. Thanks to @toonztudio for pointing me out replying in Github.