Showing
1 changed file
with
5 additions
and
2 deletions
@@ -64,13 +64,16 @@ class MyAppState extends State<MyApp> { | @@ -64,13 +64,16 @@ class MyAppState extends State<MyApp> { | ||
64 | referenceBox.localToGlobal(referenceBox.paintBounds.bottomRight); | 64 | referenceBox.localToGlobal(referenceBox.paintBounds.bottomRight); |
65 | final Rect bounds = Rect.fromPoints(topLeft, bottomRight); | 65 | final Rect bounds = Rect.fromPoints(topLeft, bottomRight); |
66 | 66 | ||
67 | + try { | ||
67 | final Printer printer = await Printing.pickPrinter(bounds: bounds); | 68 | final Printer printer = await Printing.pickPrinter(bounds: bounds); |
69 | + print('Selected printer: $selectedPrinter'); | ||
68 | 70 | ||
69 | setState(() { | 71 | setState(() { |
70 | selectedPrinter = printer; | 72 | selectedPrinter = printer; |
71 | }); | 73 | }); |
72 | - | ||
73 | - print('Selected printer: $selectedPrinter'); | 74 | + } catch (e) { |
75 | + print(e); | ||
76 | + } | ||
74 | } | 77 | } |
75 | 78 | ||
76 | Future<void> _directPrintPdf() async { | 79 | Future<void> _directPrintPdf() async { |
-
Please register or login to post a comment