搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.3

flutter_esc_pos_network

該庫允許使用熱敏Wi-Fi/乙太網路印表機透過ESC/POS指令列印收據。

AndroidiOSmacOSWindowsLinux
近 30 天下載
2770
喜歡數
30
Pub 分數
130

安裝套件

flutter pub add flutter_esc_pos_network

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,透過 Wi-Fi 或乙太網連接的熱敏印表機支援 ESC/POS 指令進行收據列印。它利用標準 ESC/POS 協定與網路印表機通訊,非常適合用於銷售點系統和零售應用。此套件支援多個平台,包括 Android、iOS、macOS、Windows 和 Linux,確保跨平台相容性。開發者可直接從其 Flutter 應用程式將格式化文字、條碼和影像傳送至印表機。

適用情境

  • 銷售點系統
  • 零售收據打印
  • 餐廳訂單列印
  • 庫存管理
  • 事件票務列印

主要特色

  • Wi-Fi 和以太網印表機支援
  • ESC/POS 指令相容性
  • 跨平台功能
  • 文字、條碼和圖像列印
  • 與 Flutter 應用的簡單整合

適合對象

  • 零售開發者
  • POS應用創建者
  • 需要列印的行動應用開發者
  • 具有網路熱敏列印機的企業
  • 物聯網支援的自助服務終端解決方案

使用建議

  • 需要相容的ESC/POS列印機
  • 需要網絡配置
  • 印表機IP位址必須已知
  • 僅限網路連接裝置
  • 無內建印表機發現功能

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_esc_pos_network

The library allows to print receipts using an ESC/POS thermal WiFi/Ethernet printer. For Bluetooth printers, use esc_pos_bluetooth library.

It can be used in Flutter or pure Dart projects. For Flutter projects, both Android, iOS, windows, Linux and MacOS are supported.

To scan for printers in your network, consider using ping_discover_network package. Note that most of the ESC/POS printers by default listen on port 9100.

TODO (PRs are welcomed!)

  • Print QR Codes using the GS ( k command (printing QR code from an image already supported)
  • PDF-417 Barcodes using the GS ( k command
  • Line spacing using the ESC 3 <n> command

How to Help

  • Test your printer and add it in the table: Wifi/Network printer or Bluetooth printer
  • Test and report bugs
  • Share your ideas about what could be improved (code optimization, new features...)
  • PRs are welcomed!

Tested Printers

Here are some printers tested with this library. Please add the models you have tested to maintain and improve this library and help others to choose the right printer.

Generate a Receipt

Simple Receipt with Styles:
void testReceipt(NetworkPrinter printer) {
  printer.text(
        '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');
  printer.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',
      styles: PosStyles(codeTable: 'CP1252'));
  printer.text('Special 2: blåbærgrød',
      styles: PosStyles(codeTable: 'CP1252'));

  printer.text('Bold text', styles: PosStyles(bold: true));
  printer.text('Reverse text', styles: PosStyles(reverse: true));
  printer.text('Underlined text',
      styles: PosStyles(underline: true), linesAfter: 1);
  printer.text('Align left', styles: PosStyles(align: PosAlign.left));
  printer.text('Align center', styles: PosStyles(align: PosAlign.center));
  printer.text('Align right',
      styles: PosStyles(align: PosAlign.right), linesAfter: 1);

  printer.text('Text size 200%',
      styles: PosStyles(
        height: PosTextSize.size2,
        width: PosTextSize.size2,
      ));

  printer.feed(2);
  printer.cut();
}

You can find more examples here: flutter_esc_pos_utils.

Print a Receipt

import 'package:flutter_esc_pos_network/flutter_esc_pos_network.dart';
final printer = PrinterNetworkManager('192.168.1.100');
    PosPrintResult connect = await printer.connect();
    if (connect == PosPrintResult.success) {
      PosPrintResult printing = await printer.printTicket(ticket);

      print(printing.msg);
      printer.disconnect();
    }
  }

For a complete example, check example/example.dart

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。