Search packages, repositories and app categories

Package detailsv2.0.0

widget_to_image

A simple package to convert any of your widgets into an image.

30-day downloads
128
Likes
34
Pub points
55

Install package

flutter pub add widget_to_image

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

widget_to_image is a Flutter package that enables developers to convert any widget into a high-quality image. It simplifies the process of capturing UI elements programmatically, making it ideal for generating previews, exporting designs, or creating dynamic screenshots within an app. The package works by rendering widgets to an image using Flutter's rendering pipeline, ensuring accurate visual representation. It supports both Android and iOS platforms and integrates seamlessly with existing Flutter projects.

Use cases

  • Generating app previews
  • Creating dynamic screenshots
  • Exporting UI components as images
  • Building design tools
  • Testing visual layouts

Key features

  • Converts any widget to an image
  • High-fidelity output
  • Simple API integration
  • Supports multiple platforms
  • No external dependencies

Suitable for

  • UI testing
  • Design prototyping
  • App preview generation
  • Developer tools
  • Visual debugging

Considerations

  • Requires proper context for widget rendering
  • May impact performance with complex widgets
  • Limited to static image output
  • Not suitable for real-time video capture
  • Needs careful handling in async operations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Widget To Image

pub package

A simple package to convert any of your widgets into an image

Usage

Import the package
import 'package:widget_to_image/widget_to_image.dart';
Use the package
ByteData byteData = await WidgetToImage.widgetToImage(Container(
    width: 100,
    height: 100,
    color: Colors.blue
));
OR
ByteData byteData = await WidgetToImage.repaintBoundaryToImage(key);

Example

Find the example wiring in the widget_to_image example application.

Details

See the widget_to_image.dart for more details.

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

Categories

Source repository

Projects using this package