'how to take screen shot from any screen flutter?

I have a flutter application which have more than 10 screens and I need to take a screenshot of the opened screen when a specific event happened [event not by user so I don't know the opened screen] without .

I want a General solution because I tried Screen shot package But I need to wrap every page with ScreenShot and save its controller but don't work because It's not expandable if I increase the pages and I some cases the event come from a thread and a can't know the opened page now



Sources

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

Source: Stack Overflow

Solution Source