asaarnak
Committed by David PHAM-VAN

check if widget is mounted before setState

... ... @@ -158,6 +158,9 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom>
if (!infoLoaded) {
infoLoaded = true;
Printing.info().then((PrintingInfo printingInfo) {
if (!mounted) {
return;
}
setState(() {
info = printingInfo;
raster();
... ...