widgets_to_image 0.0.3 copy "widgets_to_image: ^0.0.3" to clipboard
widgets_to_image: ^0.0.3 copied to clipboard

A simple package to convert any widgets into an image, everything in flutter is rendered pixel by pixel.

Widgets To Image #

A simple flutter package to export your widget to image with flutter

Installation #

  1. Add this to your package's pubspec.yaml file:
dependencies:
  widgets_to_image: any
  1. Get the package using your IDE's GUI or via command line with
$ pub get
  1. Import the widgets_to_image.dart file in your app
import 'package:widgets_to_image/widgets_to_image.dart';

Usage #

// WidgetsToImageController to access widget
WidgetsToImageController controller = WidgetsToImageController();
// to save image bytes of widget
Uint8List? bytes;

WidgetsToImage(
  controller: controller,
  child: cardWidget(),
),

final bytes = await controller.capture();

Screenshots #

Helper resource #

Thanks to Parth Jansari (Twitter: @JohannesMilke)

https://medium.com/flutter-community/export-your-widget-to-image-with-flutter-dc7ecfa6bafb

https://www.youtube.com/watch?v=DSJ5vONP3XM

113
likes
140
pub points
97%
popularity

Publisher

verified publishermohamed-abdo.com

A simple package to convert any widgets into an image, everything in flutter is rendered pixel by pixel.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on widgets_to_image