Showing
3 changed files
with
8 additions
and
3 deletions
| @@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | import 'dart:async'; | 19 | import 'dart:async'; |
| 20 | +import 'dart:typed_data'; | ||
| 20 | import 'dart:ui'; | 21 | import 'dart:ui'; |
| 21 | 22 | ||
| 22 | import 'package:flutter/services.dart'; | 23 | import 'package:flutter/services.dart'; |
| @@ -33,8 +34,9 @@ class Printing { | @@ -33,8 +34,9 @@ class Printing { | ||
| 33 | if (document != null) bytes = document.save(); | 34 | if (document != null) bytes = document.save(); |
| 34 | 35 | ||
| 35 | final Map<String, dynamic> params = <String, dynamic>{ | 36 | final Map<String, dynamic> params = <String, dynamic>{ |
| 36 | - 'doc': bytes, | 37 | + 'doc': new Uint8List.fromList(bytes), |
| 37 | }; | 38 | }; |
| 39 | + | ||
| 38 | await _channel.invokeMethod('printPdf', params); | 40 | await _channel.invokeMethod('printPdf', params); |
| 39 | } | 41 | } |
| 40 | 42 | ||
| @@ -50,7 +52,7 @@ class Printing { | @@ -50,7 +52,7 @@ class Printing { | ||
| 50 | } | 52 | } |
| 51 | 53 | ||
| 52 | final Map<String, dynamic> params = <String, dynamic>{ | 54 | final Map<String, dynamic> params = <String, dynamic>{ |
| 53 | - 'doc': bytes, | 55 | + 'doc': new Uint8List.fromList(bytes), |
| 54 | 'x': bounds.left, | 56 | 'x': bounds.left, |
| 55 | 'y': bounds.top, | 57 | 'y': bounds.top, |
| 56 | 'w': bounds.width, | 58 | 'w': bounds.width, |
| @@ -2,7 +2,7 @@ name: printing | @@ -2,7 +2,7 @@ name: printing | ||
| 2 | author: David PHAM-VAN <dev.nfet.net@gmail.com> | 2 | author: David PHAM-VAN <dev.nfet.net@gmail.com> |
| 3 | description: Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers | 3 | description: Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers |
| 4 | homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing | 4 | homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing |
| 5 | -version: 1.0.4 | 5 | +version: 1.0.5 |
| 6 | 6 | ||
| 7 | environment: | 7 | environment: |
| 8 | sdk: ">=1.19.0 <3.0.0" | 8 | sdk: ">=1.19.0 <3.0.0" |
-
Please register or login to post a comment