screenshot
screenshot copied to clipboard
Allow screenshots with specific dimensions
The plugin works pretty well, but when I export the image it is saved as a full page screenshot with the widget that I am taking screenshot of in center and black area on top and bottom. Is it possible to create dimensions that we can use to take screenshot like providing a specific height and width. Or cropping it to the specified dimensions before saving in gallery.
From what I have gathered the captureFromWidget
method uses the ui.window.physicalSize
which is probably bc it also uses ui.window
.
I am unsure, if this can be changed, but will try a thing or two.
This is what I've tested so far
- [x] wrapping the method and/or the widget in a seperate
MediaQuery(child: child)
- [x] wrapping the method and/or the widget in a seperate
Theme(child: child)
- [x] wrapping the widget widget in a
Sizedbox(height: 100, width: 100, child: child)
- [ ] editing the method myself
Edit: Once I started to work on the package myself, I quickly found out, that @SachinGanesh has already solved the problem (thx for this :+1:). Unfortunately the package on pub.dev has the same package version, even though the github version is more recent. So @SachinGanesh please push the most recent version to pub.dev, so other developer do not have to waste 2h, when you already took the effort of implenting such feature :heart:.
P.S. For everyone wondering: the captureFromWidget
now supports a targetSize
Hey @jlnrrg did you find any way to calculate the targetSize automatically? I have a list of items and don't know the exact size yet.
@bobatsar I solved it by only using fixed sized components and then calculating the width and height based on the amount. I know this does not answer your question unfortunately :disappointed:
Hey @jlnrrg I am using the captureFromWidget
method but I can not find the targetSize
option, I need to crate screenshot of specific height and with, I am currently running version screenshot: ^1.2.3
Please use latest version of plugin to set target size. Closing this issue