We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Stateful Widget, Screenshot(this package) works fine, but i have to work with Hook Widget.
In first build, screenshot works fine, but if changing anything in the screen, then capturing screenshot return null value.
Screenshot( //Supply the screenshotController to Screenshot widget controller: screenshotController, child: AnimatedContainer( curve: Curves.easeInOutCirc, duration: const Duration(milliseconds: 700), padding: const EdgeInsets.fromLTRB(0, 10, 0, 10), alignment: Alignment.center, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: backGroundColor.value, ), ), child: Text('Hello World'), ), ),
Here in Hook Widget, i am changing backgroundColor.value from Hook Widget. After changing anything screenshot package doesn't works.
backgroundColor.value
It only works in first build.
Capturing method is
onPressed: () async { //Capture the Widget as Image final uint8List = await screenshotController.capture(); //Get temp directory to cache it(will be deleted later) String tempPath = (await getTemporaryDirectory()).path; File file = File('$tempPath/image.png'); //Save as temporary file await file.writeAsBytes(uint8List!); //Share the temporay saved image with Android/iOS native share dialogue await Share.shareXFiles([XFile(file.path)]); },
The text was updated successfully, but these errors were encountered:
I've solve this problem supplying optional GlobalKey() in ScreenShot widget.
GlobalKey()
Screenshot( key:GlobalKey() //By adding this, problem is solved //Supply the screenshotController to Screenshot widget controller: screenshotController, child: AnimatedContainer( curve: Curves.easeInOutCirc, duration: const Duration(milliseconds: 700), padding: const EdgeInsets.fromLTRB(0, 10, 0, 10), alignment: Alignment.center, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: backGroundColor.value, ), ), child: Text('Hello World'), ), ),
But the ui is rebuilding every time i change anything in the screen
Sorry, something went wrong.
No branches or pull requests
In Stateful Widget, Screenshot(this package) works fine, but i have to work with Hook Widget.
In first build, screenshot works fine, but if changing anything in the screen, then capturing screenshot return null value.
Here in Hook Widget, i am changing
backgroundColor.value
from Hook Widget.After changing anything screenshot package doesn't works.
It only works in first build.
Capturing method is
The text was updated successfully, but these errors were encountered: