@@ -8,57 +8,26 @@ import 'package:meta/meta.dart' show visibleForTesting;
88
99import 'package:flutter_printer_qpos/QPOSPrintModel.dart' ;
1010
11- enum PrintLine {
12- LEFT ,
13- CENTER ,
14- RIGHT
15- }
16-
17- enum FontStyle {
18- NORMAL ,
19- BOLD ,
20- ITALIC ,
21- BOLD_ITALIC
22- }
23-
24- enum Symbology {
25- CODE_128 ,
26- CODABAR ,
27- CODE_39 ,
28- EAN_8 ,
29- EAN_13 ,
30- UPC_A ,
31- UPC_E
32- }
11+ enum PrintLine { LEFT , CENTER , RIGHT }
3312
34- enum ErrorLevel {
35- L ,
36- M ,
37- Q ,
38- H
39- }
13+ enum FontStyle { NORMAL , BOLD , ITALIC , BOLD_ITALIC }
4014
15+ enum Symbology { CODE_128 , CODABAR , CODE_39 , EAN_8 , EAN_13 , UPC_A , UPC_E }
4116
17+ enum ErrorLevel { L , M , Q , H }
4218
43- enum Barcode2D {
44- QR_CODE
45- }
19+ enum Barcode2D { QR_CODE }
4620
47-
48- enum Barcode1D {
49- CODE_128 ,
50- CODABAR
51- }
21+ enum Barcode1D { CODE_128 , CODABAR }
5222
5323class FlutterPrinterQpos {
54-
55- factory FlutterPrinterQpos (){
24+ factory FlutterPrinterQpos () {
5625 if (_instance == null ) {
57- final MethodChannel methodChannel = const MethodChannel (
58- 'flutter_printer_qpos' );
26+ final MethodChannel methodChannel =
27+ const MethodChannel ( 'flutter_printer_qpos' );
5928
60- final EventChannel eventChannel = const EventChannel (
61- 'flutter_printer_qpos_event' );
29+ final EventChannel eventChannel =
30+ const EventChannel ( 'flutter_printer_qpos_event' );
6231
6332 _instance = FlutterPrinterQpos .private (methodChannel, eventChannel);
6433 }
@@ -152,19 +121,33 @@ class FlutterPrinterQpos {
152121 params['height' ] = height;
153122 params['content' ] = content;
154123 params['position' ] = position;
155- print ('dart:printBarCode' + symbology + " " + width + " " + height + " " +
156- content + " " + position);
124+ print ('dart:printBarCode' +
125+ symbology +
126+ " " +
127+ width +
128+ " " +
129+ height +
130+ " " +
131+ content +
132+ " " +
133+ position);
157134 _methodChannel.invokeMethod ('printBarCode' , params);
158135 }
159136
160- void printQRCode (String errorLevel, String width, String content,
161- String position) {
137+ void printQRCode (
138+ String errorLevel, String width, String content, String position) {
162139 Map <String , String > params = Map <String , String >();
163140 params['errorLevel' ] = errorLevel;
164141 params['width' ] = width;
165142 params['content' ] = content;
166143 params['position' ] = position;
167- print ('dart:printQRCode' + errorLevel + " " + width + " " + content + " " +
144+ print ('dart:printQRCode' +
145+ errorLevel +
146+ " " +
147+ width +
148+ " " +
149+ content +
150+ " " +
168151 position);
169152 _methodChannel.invokeMethod ('printQRCode' , params);
170153 }
@@ -176,15 +159,13 @@ class FlutterPrinterQpos {
176159 _methodChannel.invokeMethod ('printBitmap' , params);
177160 }
178161
179-
180162 void addtext (String text) {
181163 Map <String , String > params = Map <String , String >();
182164 params['text' ] = text;
183165 print ('dart:addtext' + text.toString ());
184166 _methodChannel.invokeMethod ('addText' , params);
185167 }
186168
187-
188169 void addTexts (String text1, String text2, String row1, String row2,
189170 String position1, String position2) {
190171 Map <String , String > params = Map <String , String >();
@@ -198,7 +179,6 @@ class FlutterPrinterQpos {
198179 _methodChannel.invokeMethod ('addTexts' , params);
199180 }
200181
201-
202182 // void addBitmap(Uint8List bitmap) {
203183 // Map<String, Uint8List> params = Map<String, Uint8List>();
204184 // params['bitmap'] = bitmap;
@@ -215,7 +195,7 @@ class FlutterPrinterQpos {
215195 _methodChannel.invokeMethod ('addBitmap' , params);
216196 }
217197
218- void addQRCode (String size, String qrName, String context, String position){
198+ void addQRCode (String size, String qrName, String context, String position) {
219199 Map <String , String > params = Map <String , String >();
220200 params['size' ] = size;
221201 params['qrName' ] = qrName;
@@ -225,8 +205,8 @@ class FlutterPrinterQpos {
225205 _methodChannel.invokeMethod ('addQRCode' , params);
226206 }
227207
228-
229- void addBarCode ( String BarName , String width, String height, String context, String position){
208+ void addBarCode ( String BarName , String width, String height, String context,
209+ String position) {
230210 Map <String , String > params = Map <String , String >();
231211 params['BarName' ] = BarName ;
232212 params['width' ] = width;
@@ -237,7 +217,6 @@ class FlutterPrinterQpos {
237217 _methodChannel.invokeMethod ('addBarCode' , params);
238218 }
239219
240-
241220 void printReceipt () {
242221 _methodChannel.invokeMethod ('print' );
243222 }
@@ -269,5 +248,4 @@ class FlutterPrinterQpos {
269248 void releaseSound () {
270249 _methodChannel.invokeMethod ('releaseSound' );
271250 }
272-
273251}
0 commit comments