A simple flutter package to export your widget to image with flutter
pubspec.yaml
file:dependencies:
widgets_to_image: any
$ pub get
widgets_to_image.dart
file in your appimport 'package:widgets_to_image/widgets_to_image.dart';
// 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();