screenshot
3.0.0, released 3 years ago by dsi.dev
Capture any widget as an image, including invisible widgets, at runtime.
What it does
This package wraps a widget in a RenderRepaintBoundary and provides methods to capture it as a Uint8List. It supports capturing widgets not in the tree, long widgets, and saving or sharing the resulting image.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need to take screenshots of widgets for sharing or saving
- Want to capture widgets that are not currently rendered
- Need to generate images from UI components for reports or previews
Skip it when
- Working on web only, as captureAndSave is not supported
- Using platform views like Google Maps or Camera, which are unsupported
Strengths
- Simple API, works on all platforms except web for saving
- Supports invisible and long widgets
- Allows pixelRatio and delay customization
- No external dependencies beyond Flutter
Weaknesses
- Not supported for web when saving
- Platform views unsupported
- Requires Flutter 3.22+ for latest version
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dependency and import package, create ScreenshotController, wrap widget with Screenshot widget
ScreenshotController controller = ScreenshotController();
Screenshot(controller: controller, child: Text('Hello'));
controller.capture().then((image) => /* use Uint8List */);Alternatives
Packages that do the same job and could replace screenshot.
- scroll_screenshot
Capture full‑page Flutter screenshots, including off‑screen content, via a simple API.
53Compare
Works with
Packages commonly used together with screenshot: ones it builds on, ones built on it, and its own family.