/native_screenshot_widget

A Flutter plugin to take screenshot(support Platform Views) for Android and iOS with native code.

Primary LanguageDartBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

native_screenshot_widget

pub package | pub points | popularity

Using

//PlatformView: e.g: WebView
final screenshotController = NativeScreenshotController();

NativeScreenshot(
controller: screenshotController,
child: WebViewWidget(
controller: WebViewController()
..loadRequest(Uri.parse('https://flutter.dev')),
),
);


//take screenshot:
final imageBytes = await screenshotController.takeScreenshot();
//Flutter Widget
final screenshotController = NativeScreenshotController();

NativeScreenshot(
controller: screenshotController,
child: Text(
"Flutter Widget",
style: Theme.of(context).textTheme.titleLarge,
),
),
//take screenshot:
final imageBytes = await screenshotController.takeScreenshot();