'How to take a screenshot in Flutter of a widget bigger than the height of the mobile screen?

I am using an invisible widget StaggeredGridView which is bigger than the height of the emulator/mobile. The image is rendering only a part of it, I didn't find any answer relevant to this problem

  screenshotController
     .captureFromWidget(
       StaggeredGridView.count(
         crossAxisCount: 4,
         staggeredTiles: _staggeredTiles,
         children: _tiles,
       ),)
     .then((capturedImage) {
   // Handle captured image
   ImageGallerySaver.saveImage(
       Uint8List.fromList(capturedImage),
       quality: 90,
       name: "WomanVerseWallpaper");
 });

The screen which I want to take a screenshot of the widget (bigger than the screen, it continues) enter image description here

What I'm getting

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source