widget_screenshot_plus 0.0.2 copy "widget_screenshot_plus: ^0.0.2" to clipboard
widget_screenshot_plus: ^0.0.2 copied to clipboard

retracted

A fork of widget_screenshot plugin. Flutter package for capturing widgets as high-quality images, including scrollable content. Perfect for sharing app content, creating previews, or saving widget sta [...]

Widget Screenshot Plus - Flutter Package #

Pub Version License

This package is a Fork of widget_screenshot updated to the lasted version of flutter and dart.

A Flutter package for capturing widgets as images, including scrollable content and complex layouts. Perfect for sharing app content, creating previews, or saving widget states.

Features #

  • 📸 Capture any widget as an image
  • 🖼️ Handle scrollable content (ListView, CustomScrollView, etc.)
  • 🎨 Customize output format (PNG/JPEG) and quality
  • 🖌️ Add background colors to screenshots
  • 📱 Support for high DPI screens with pixel ratio control
  • 🧩 Merge multiple images into one composition

Android #

[media_doc/list_scroll_android.gif] [media_doc/single_widget_android.gif]

IOS #

[media_doc/list_scroll_ios.gif] [media_doc/single_widget_ios.gif]

Installation #

Add to your pubspec.yaml:

dependencies:
  widget_screenshot_plus: ^latest_version

Basic Usage #

1. Wrap your widget #

WidgetShotPlus(
  key: _screenshotKey,
  child: YourWidget(),
)

2. Capture the screenshot #

final boundary = _screenshotKey.currentContext?.findRenderObject()
        as WidgetShotPlusRenderRepaintBoundary?;

final imageBytes = await boundary?.screenshot(
  format: ShotFormat.png,
  quality: 100,
);

Examples #

Simple Widget Capture #

// Wrap your widget
WidgetShotPlus(
  key: _screenshotKey,
  child: Container(
    color: Colors.blue,
    child: Text('Capture me!'),
  ),
)

// Capture it
final imageBytes = await boundary.screenshot();

Scrollable Content #

// Use with scroll controller
final _scrollController = ScrollController();

WidgetShotPlus(
  key: _screenshotKey,
  child: ListView(
    controller: _scrollController,
    children: [...],
  ),
)

// Capture entire scrollable content
final imageBytes = await boundary.screenshot(
  scrollController: _scrollController,
);

Save and Share #

// Save to file
final dir = await getApplicationDocumentsDirectory();
final imageFile = File('${dir.path}/screenshot.png');
await imageFile.writeAsBytes(imageBytes!);

// Share using share_plus
await Share.shareXFiles([XFile(imageFile.path)]);

Advanced Options #

Parameter Description Default
format Output format (PNG/JPEG) ShotFormat.png
quality Image quality (0-100) 100
pixelRatio Device pixel ratio Device default
backgroundColor Background color for the screenshot null (transparent)
scrollController For capturing scrollable content null
maxHeight Maximum height for scroll capture 10000

FAQ #

Q: Can I capture widgets that are not currently visible on screen?
A: Yes! The package can capture the entire widget tree regardless of visibility.

Q: How does it handle platform differences?
A: The package uses a platform interface with method channel implementation, ensuring consistent behavior across iOS and Android.

Limitations #

  • Very large captures may cause memory issues (consider splitting extremely long content)
  • Web support requires canvas-based rendering
  • Some platform-specific widgets may render differently in screenshots

Contributing #

Contributions are welcome! Please open issues or pull requests for any bugs or feature suggestions.

License #

MIT - See LICENSE for details.

4
likes
0
points
228
downloads

Publisher

unverified uploader

Weekly Downloads

A fork of widget_screenshot plugin. Flutter package for capturing widgets as high-quality images, including scrollable content. Perfect for sharing app content, creating previews, or saving widget states. Supports PNG/JPEG formats, background customization, and handles complex layouts with ease.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on widget_screenshot_plus

Packages that implement widget_screenshot_plus