Я недавно использовал снимок экрана плагин с pretty_qr_code
ScreenshotController screenshotController = ScreenshotController();
Screenshot(
controller: screenshotController,
child: PrettyQr(
image:AssetImage(AppConfig.placeholder),
typeNumber: 4,
size: 300,
elementColor: Color(0xff596DFF),
data: invitationCode,
errorCorrectLevel: QrErrorCorrectLevel.Q,
roundEdges: false
),
)
Future<void> _captureAndSharePng() async {
screenshotController.capture().then((File image1) async {
//Capture Done
List<int> bytes1 = await image1.readAsBytes();
await Share.file("Code",
'title' + ".jpg", bytes1, 'image/jpg',
text: "Join Group by scanning this code"
);
}).catchError((onError) {
print(onError);
});
}
Обмен изображениями с использованием esys_flutter_share