diff --git a/lib/src/network_printer.dart b/lib/src/network_printer.dart index abec81f..a24e143 100644 --- a/lib/src/network_printer.dart +++ b/lib/src/network_printer.dart @@ -53,11 +53,12 @@ class NetworkPrinter { } // ************************ Printer Commands ************************ - void reset() { + List reset() { _socket.add(_generator.reset()); + return []; } - void text( + List text( String text, { PosStyles styles = const PosStyles(), int linesAfter = 0, @@ -69,58 +70,71 @@ class NetworkPrinter { linesAfter: linesAfter, containsChinese: containsChinese, maxCharsPerLine: maxCharsPerLine)); + return []; } - void setGlobalCodeTable(String codeTable) { + List setGlobalCodeTable(String codeTable) { _socket.add(_generator.setGlobalCodeTable(codeTable)); + return []; } - void setGlobalFont(PosFontType font, {int? maxCharsPerLine}) { + List setGlobalFont(PosFontType font, {int? maxCharsPerLine}) { _socket .add(_generator.setGlobalFont(font, maxCharsPerLine: maxCharsPerLine)); + return []; } - void setStyles(PosStyles styles, {bool isKanji = false}) { + List setStyles(PosStyles styles, {bool isKanji = false}) { _socket.add(_generator.setStyles(styles, isKanji: isKanji)); + return []; } - void rawBytes(List cmd, {bool isKanji = false}) { + List rawBytes(List cmd, {bool isKanji = false}) { _socket.add(_generator.rawBytes(cmd, isKanji: isKanji)); + return []; } - void emptyLines(int n) { + List emptyLines(int n) { _socket.add(_generator.emptyLines(n)); + return []; } - void feed(int n) { + List feed(int n) { _socket.add(_generator.feed(n)); + return []; } - void cut({PosCutMode mode = PosCutMode.full}) { + List cut({PosCutMode mode = PosCutMode.full}) { _socket.add(_generator.cut(mode: mode)); + return []; } - void printCodeTable({String? codeTable}) { + List printCodeTable({String? codeTable}) { _socket.add(_generator.printCodeTable(codeTable: codeTable)); + return []; } - void beep({int n = 3, PosBeepDuration duration = PosBeepDuration.beep450ms}) { + List beep({int n = 3, PosBeepDuration duration = PosBeepDuration.beep450ms}) { _socket.add(_generator.beep(n: n, duration: duration)); + return []; } - void reverseFeed(int n) { + List reverseFeed(int n) { _socket.add(_generator.reverseFeed(n)); + return []; } - void row(List cols) { + List row(List cols) { _socket.add(_generator.row(cols)); + return []; } - void image(Image imgSrc, {PosAlign align = PosAlign.center}) { + List image(Image imgSrc, {PosAlign align = PosAlign.center}) { _socket.add(_generator.image(imgSrc, align: align)); + return []; } - void imageRaster( + List imageRaster( Image image, { PosAlign align = PosAlign.center, bool highDensityHorizontal = true, @@ -134,9 +148,10 @@ class NetworkPrinter { highDensityVertical: highDensityVertical, imageFn: imageFn, )); + return []; } - void barcode( + List barcode( Barcode barcode, { int? width, int? height, @@ -152,26 +167,30 @@ class NetworkPrinter { textPos: textPos, align: align, )); + return []; } - void qrcode( + List qrcode( String text, { PosAlign align = PosAlign.center, QRSize size = QRSize.Size4, QRCorrection cor = QRCorrection.L, }) { _socket.add(_generator.qrcode(text, align: align, size: size, cor: cor)); + return []; } - void drawer({PosDrawer pin = PosDrawer.pin2}) { + List drawer({PosDrawer pin = PosDrawer.pin2}) { _socket.add(_generator.drawer(pin: pin)); + return []; } - void hr({String ch = '-', int? len, int linesAfter = 0}) { + List hr({String ch = '-', int? len, int linesAfter = 0}) { _socket.add(_generator.hr(ch: ch, linesAfter: linesAfter)); + return []; } - void textEncoded( + List textEncoded( Uint8List textBytes, { PosStyles styles = const PosStyles(), int linesAfter = 0, @@ -183,6 +202,7 @@ class NetworkPrinter { linesAfter: linesAfter, maxCharsPerLine: maxCharsPerLine, )); + return []; } // ************************ (end) Printer Commands ************************ } diff --git a/pubspec.lock b/pubspec.lock index aaeaca1..a61d6a6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,86 +5,90 @@ packages: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: a92e39b291073bb840a72cf43d96d2a63c74e9a485d227833e8ea0054d16ad16 + url: "https://pub.dev" source: hosted version: "3.1.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" charset_converter: dependency: "direct main" description: name: charset_converter - url: "https://pub.dartlang.org" + sha256: a05e3efe8b76146cdd13606a57c7b559b624d924384f1ad3f0cff303c03c8be1 + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.18.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: f857285c8dc0b4f2f77b49a1c083ff8c75223a7549de20f3e607df58cf497a43 + url: "https://pub.dev" source: hosted version: "0.17.0" esc_pos_utils: dependency: "direct main" description: name: esc_pos_utils - url: "https://pub.dartlang.org" + sha256: "8ec0013d7a7f1e790ced6b09b95ce3bf2c6f9468a3e2bc49ece000761d86c6f8" + url: "https://pub.dev" source: hosted version: "1.1.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -99,56 +103,96 @@ packages: dependency: transitive description: name: gbk_codec - url: "https://pub.dartlang.org" + sha256: "3af5311fc9393115e3650ae6023862adf998051a804a08fb804f042724999f61" + url: "https://pub.dev" source: hosted version: "0.4.0" hex: dependency: transitive description: name: hex - url: "https://pub.dartlang.org" + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + url: "https://pub.dev" source: hosted version: "0.15.0" image: dependency: "direct main" description: name: image - url: "https://pub.dartlang.org" + sha256: bb9f31e29110ca9ed55d371256d0dab5ee622896aca7330d007fc1a36aaba732 + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" source: hosted version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.15.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: b1e35bcd00e0ab63a4883d7d76461da7477dcac3ab82fa0ab894be729d579032 + url: "https://pub.dev" source: hosted version: "4.3.0" sky_engine: @@ -160,65 +204,82 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.7.2" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "14.2.5" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "78bc0a9ed038e65944b95f4c5d3a72a607d63e1a9f1e8281fa0cfe9d2811c279" + url: "https://pub.dev" source: hosted version: "5.3.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=1.10.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index e637a09..489b3ed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,11 +8,14 @@ environment: dependencies: charset_converter: ^2.0.0 - esc_pos_utils: ^1.1.0 + esc_pos_utils: + git: + url: https://github.com/tkygcw/esc_pos_utils.git + ref: master + # esc_pos_utils_plus: ^2.0.2 + flutter: sdk: flutter - # esc_pos_utils: - # path: ../esc_pos_utils image: ^3.0.2 dev_dependencies: