I need to take screenshot of widget but didn't want to show the widget on screen.
I am doing this right now
My widget
showSc ? Screenshot(
controller: screenshotController,
child: Container(
color: Color(0xffE5E7E9),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Payment Reminder', style: TextStyle(
fontFamily: 'PoppinsRegular',
fontSize: 19,
color: Color(0xff8f9ba8))),
Text(Ggive.toString(), style: TextStyle(
fontFamily: 'PoppinsBold',
fontSize: 17,
color: Colors.red)),
SizedBox(height: 20,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Text(widget.data['selererName'].toString(), style: TextStyle(
fontFamily: 'PoppinsBold',
fontSize: 15,
color: Color(0xff8f9ba8))),
],
),
Image.asset('images/splash-logo.png', width: 120,)
],
)
],
),
),
),
) : Container(),
Capture
GestureDetector(
onTap: () async {
print('click');
_imageFile = null;
screenshotController
.capture()
.then((Uint8List image) async {
_imageFile = image;
print(base64Encode(_imageFile));
FlutterShareMe()
.shareToWhatsApp(base64Image: 'data:image/jpeg;base64,${base64Encode(_imageFile)}', msg: 'Apna ${widget.data['selererName']} ko ${Ggive.toString()} Rupees dene hein');
}).catchError((onError) {
print(onError);
});
},
child: Column(
children: [
Icon(Icons.messenger_outline_outlined),
Text(
'Whatsapp',
style: TextStyle(fontFamily: 'PoppinsRegular'),
)
],
),
),
But when i take screenshot and send to WhatsApp its not sending and if make showSc bool true then its working fine but i don't want to show this widget any one can give solution for this i am stuck here -_-