{"id":16883575,"url":"https://github.com/salemcode8/flutter_esc_pos_bluetooth","last_synced_at":"2025-04-11T21:33:10.483Z","repository":{"id":56829359,"uuid":"408694274","full_name":"SalemCode8/flutter_esc_pos_bluetooth","owner":"SalemCode8","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-21T05:07:20.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T17:46:51.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SalemCode8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-21T05:06:32.000Z","updated_at":"2022-06-30T15:32:23.000Z","dependencies_parsed_at":"2022-09-02T05:50:22.898Z","dependency_job_id":null,"html_url":"https://github.com/SalemCode8/flutter_esc_pos_bluetooth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalemCode8%2Fflutter_esc_pos_bluetooth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalemCode8%2Fflutter_esc_pos_bluetooth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalemCode8%2Fflutter_esc_pos_bluetooth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalemCode8%2Fflutter_esc_pos_bluetooth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalemCode8","download_url":"https://codeload.github.com/SalemCode8/flutter_esc_pos_bluetooth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483417,"owners_count":21111444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:12:24.131Z","updated_at":"2025-04-11T21:33:10.460Z","avatar_url":"https://github.com/SalemCode8.png","language":"Dart","readme":"# esc_pos_bluetooth\n\n[![Pub Version](https://img.shields.io/pub/v/esc_pos_bluetooth)](https://pub.dev/packages/esc_pos_bluetooth)\n\nThe library allows to print receipts using a Bluetooth printer. For WiFi/Ethernet printers, use [esc_pos_printer](https://github.com/andrey-ushakov/esc_pos_printer) library.\n\n\n## TODO (PRs are welcomed!)\n* Split byte data into chunks: [issue](https://github.com/andrey-ushakov/esc_pos_bluetooth/issues/5)\n* Print QR Codes using the `GS ( k` command (printing QR code from an image already supported)\n* PDF-417 Barcodes using the `GS ( k` command\n* Line spacing using the `ESC 3 \u003cn\u003e` command\n\n## How to Help\n* Test your printer and add it in the table: [Wifi/Network printer](https://github.com/andrey-ushakov/esc_pos_printer/blob/master/printers.md) or [Bluetooth printer](https://github.com/andrey-ushakov/esc_pos_bluetooth/blob/master/printers.md)\n* Test and report bugs\n* Share your ideas about what could be improved (code optimization, new features...)\n* PRs are welcomed!\n\n\n## Tested Printers\nHere are some [printers tested with this library](printers.md). Please add the models you have tested to maintain and improve this library and help others to choose the right printer.\n\n\n## Generate a Ticket\n\n### Simple Ticket with Styles:\n```dart\nTicket testTicket() {\n  final Ticket ticket = Ticket(PaperSize.mm80);\n\n  ticket.text(\n      'Regular: aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ');\n  ticket.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',\n      styles: PosStyles(codeTable: PosCodeTable.westEur));\n  ticket.text('Special 2: blåbærgrød',\n      styles: PosStyles(codeTable: PosCodeTable.westEur));\n\n  ticket.text('Bold text', styles: PosStyles(bold: true));\n  ticket.text('Reverse text', styles: PosStyles(reverse: true));\n  ticket.text('Underlined text',\n      styles: PosStyles(underline: true), linesAfter: 1);\n  ticket.text('Align left', styles: PosStyles(align: PosAlign.left));\n  ticket.text('Align center', styles: PosStyles(align: PosAlign.center));\n  ticket.text('Align right',\n      styles: PosStyles(align: PosAlign.right), linesAfter: 1);\n\n  ticket.text('Text size 200%',\n      styles: PosStyles(\n        height: PosTextSize.size2,\n        width: PosTextSize.size2,\n      ));\n\n  ticket.feed(2);\n  ticket.cut();\n  return ticket;\n}\n```\n\nYou can find more examples here: [esc_pos_utils](https://github.com/andrey-ushakov/esc_pos_utils).\n\n\n## Print a Ticket\n\n```dart\nPrinterBluetoothManager printerManager = PrinterBluetoothManager();\n\nprinterManager.scanResults.listen((printers) async {\n  // store found printers\n});\nprinterManager.startScan(Duration(seconds: 4));\n\n// ...\n\nprinterManager.selectPrinter(printer);\nfinal PosPrintResult res = await printerManager.printTicket(testTicket());\n\nprint('Print result: ${res.msg}');\n```\n\nFor a complete example, check the demo project [example/blue](example/blue).\n\n\n## Troubleshooting\n* If your printer prints only 5%-10% of an image and then stops, or it can't print more than 1 image on the same ticket, or it can't print long tickets, try to ajust `queueSleepTimeMs` of the `PrinterBluetoothManager.printTicket` (try 50 or 100ms): `printerManager.printTicket(await demoReceipt(paper), queueSleepTimeMs: 50);`\n\n\n## Test Print\n\u003cimg src=\"https://github.com/andrey-ushakov/esc_pos_printer/blob/master/example/receipt2.jpg?raw=true\" alt=\"test receipt\" height=\"800\"/\u003e\n\n\u003cimg src=\"https://github.com/andrey-ushakov/esc_pos_printer/blob/master/example/receipt.jpg?raw=true\" alt=\"test receipt\" height=\"500\"/\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalemcode8%2Fflutter_esc_pos_bluetooth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalemcode8%2Fflutter_esc_pos_bluetooth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalemcode8%2Fflutter_esc_pos_bluetooth/lists"}