2

How do I use flutter to save the screenshot to the gallery (android)?

I am new to flutter.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 2
    Does this answer your question? [Creating raw image from Widget or Canvas](https://stackoverflow.com/questions/41957086/creating-raw-image-from-widget-or-canvas) – Abion47 Jul 21 '20 at 05:46

1 Answers1

0

refer to my answer, add global key to your root widget. Save image with this package, gallery_saver.

GallerySaver.saveImage(imgFile.path).then((String path) {
          setState(() {
            firstButtonText = 'image saved!';
          });
        });
Jim
  • 6,928
  • 1
  • 7
  • 18
  • Hi Jim, I want to take a screenshot and I have it inside a RepaintBoundary. Please can you show how to get the screenshot with onPressed method on RaiseButton. Thanks in advance. – Jyoti Prakash Aug 01 '20 at 05:40
  • this will be the method inside onPressed: https://stackoverflow.com/a/62993541/11276416 – Jim Aug 02 '20 at 13:56