native_screenshot_widget 0.0.4 native_screenshot_widget: ^0.0.4 copied to clipboard
A Flutter plugin to take screenshot(support Platform Views) for Android and iOS with native code.
native_screenshot_widget #
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();